美文网首页
gitlab go mod 引用私有仓库(上)

gitlab go mod 引用私有仓库(上)

作者: 不要重不要重 | 来源:发表于2019-03-27 14:14 被阅读0次

1.获取gitlab的access token
打开所需要Token的项目
然后Setting --> CI/CD --> Genneral pioelines settings --> Expand --> Runner token


image.png
git config --global http.extraheader "PRIVATE-TOKEN: YOUR_PRIVATE_TOKEN"

把Runner token文本框中的内容替换上面的YOUR_PRIVATE_TOKEN
2.为GitLab帐号添加SSH keys

cat  ~/.ssh/id_rsa.pub

把上述内容添加到gitlab中


image.png image.png
image.png

3.配置git将请求从ssh转换为http

git config --global url."git@gitlab.com:groupName/projectName.git".insteadOf "https://gitlab.com/groupName/projectName.git"`

4.拉取

go get -u -v gitlab.com/groupName/projectName

相关文章

网友评论

      本文标题:gitlab go mod 引用私有仓库(上)

      本文链接:https://www.haomeiwen.com/subject/kpqzvqtx.html