How to use Go with a private GitLab repo

后端 未结 11 1677
时光说笑
时光说笑 2020-12-04 11:11

GitLab is a free, open-source way to host private .git repositories but it does not seem to work with Go. When you create a project it generates a URL of the fo

11条回答
  •  被撕碎了的回忆
    2020-12-04 11:48

    For HTTPS private gitlab repo, @Rick Smith's answer is enough. Here's a compensation for HTTP repo, first run the command:

    git config --global url."git@mygitlab.com:".insteadOf "http://mygitlab.com/"
    

    then use below go get command to get the golang project:

    go get -v  -insecure  mygitlab.com/user/repo
    

提交回复
热议问题