英文:
go get remote: The project you were looking for could not be found or you don't have permission to view it
问题
我正在使用go 1.20.1,Windows 10 x64和GoLand 2022.3.2。
前往...
,创建名为.netrc
的文件,并添加以下内容:
machine gitlab.com login my_username password my_password
设置环境变量
然后获取依赖项
go get gitlab.com/foo/bar/baa/fuu
错误信息
remote: The project you were looking for could not be found or you don't have permission to view it.
如何修复这个问题?
英文:
I am using go 1.20.1 , Windows 10 x64, GoLand 2022.3.2 .
Go to ...
, create file .netrc
with content
machine gitlab.com login my_username password my_password
Set environment variable
then get dependency
go get gitlab.com/foo/bar/baa/fuu
Error
remote: The project you were looking for could not be found or you don't have permission to view it.
How to fix it?
答案1
得分: 4
首先,请确保在 %USERPROFILE%\_netrc
文件中使用 PAT(个人访问令牌),而不是你的实际 GitLab 账户密码。
其次,请使用 go get gitlab.com/foo/bar
,而不是 foo/bar/baa/fu
。
例如 go get gitlab.com/name_or_group/repo_name
。
英文:
First, make sure to use a PAT (Personal Access Token), not your actual GitLab account password, in %USERPROFILE%\_netrc
.
Second use go get gitlab.com/foo/bar
, not foo/bar/baa/fu
.
As in go get gitlab.com/name_or_group/repo_name
.
答案2
得分: 1
在Windows操作系统上,.netrc
文件应该改为_netrc
(下划线字符),而且不使用密码,而是使用GitLab访问令牌。
英文:
on Windows OS, it is not .netrc
, it is _netrc
(underscore character) , and not use password, use GitLab access token.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论