Golang Get 私有仓库

  • error

    ...... invalid version: unknown revision

  1. 在git 配置文件中添加以下配置:
[url "ssh://[email protected]/"]
        insteadOf = https://github.com/
[url "[email protected]:"]
        insteadOf = https://github.com/
  1. 设置go的环境变量
export GOPRIVATE=github.com/私有仓库
  1. 可能需要取消GOPROXY代理值。
  2. ~/.netrc配置git登录名和token
machine github.com login git账户 password [Personal access token]

设置Personal access token

  1. 最后go get Your Repo

你可能感兴趣的:(Golang Get 私有仓库)