私有仓库配置

将gitee.com 设置为私有仓库

  1. 首先配置https请求转换为ssh:

git config --global url."[email protected]:".insteadOf "https://gitee.com/"

 git config --global http.extraheader "PRIVATE-TOKEN: B9TWLqsLdh1-513os1Pm"

git config --global url."[email protected]".insteadOf "http://192.168.200.47:8083/"
git config --global url."[email protected]".insteadOf "http://git.zhongzhuoxin.com:9000/"
  1. 配置环境变量 go env -w GOPRIVATE=gitee.com

  2. 新建的仓库名字一定要改成和仓库地址一致

  • 新建仓库 gitee.com/zouni88/util

  • 项目目录下 go.mod 修改modulegitee.com/zouni88/util

最后更新于

这有帮助吗?