How to use Go with a private GitLab repo

后端 未结 11 1675
时光说笑
时光说笑 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 12:07

    For the record, this works outside of go using gitlab 7.3.2 and, as JimB has observed, can be used as a workaround. I find that i do get prompted for username/password, even though an SSH key is registered with gitlab:

    git clone http://1.2.3.4/private-developers/project.git
    

    Alternatively i can use the SSH equivalent which, since i have an SSH key registered with gitlab, avoids the prompts:

    git clone git@1.2.3.4:private-developers/project.git
    

    Neither works with go currently. A fix may be in 7.9 but i haven't had a chance to test it: upcoming bugfix

提交回复
热议问题