go get gitlab私有仓库

修改 ~/.gitconfig

[url "[email protected]:"]
        insteadOf = https://gitlab.com/

git token

  • 创建一个token: XXXXXXXXXXXXXX
  • 设置权限: read_repository
  • git config --global http.extraheader "PRIVATE-TOKEN:XXXXXXXXXXXXXX"

如果还是不行,配上gitlab.com登录的用户名和密码,修改 ~/.netrc:

machine gitlab.com
    login xxxxx
    password xxxxxxxxxxxxxxxxxx

你可能感兴趣的:(go get gitlab私有仓库)