繁体   English   中英

如何使用go get私有github企业服务器?

[英]How do I use go get with a private github enterprise server?

我们通过VPN使用github企业服务器。

如果我输入:

go get privateserver.com/path/to/myproject.git

我得到这个结果:

package privateserver.com/path/to/myproject.git: cannot download, privateserver.com/path/to/myproject uses insecure protocol

或者删除我得到的.git后缀:

package privateserver.com/path/to/myproject: unrecognized import path "privateserver.com/path/to/myproject" (parse https://privateserver.com/path/to/myproject?go-get=1: no go-import meta tags ())

谷歌搜索似乎有很多类似的问题,但没有找到实际有用的答案。

我真正想要的是docker构建的自动化。 在我的docker文件中,我需要一个go get。 但我无法将凭证存储在docker文件中。

注意: - 灭菌不起作用。 见问题的底部。


刚尝试过-insecure -v选项。 我得到以下输出:

matthewh@xen:~/go/src/$ go get -insecure -v privateserver.com/path/to/myproject.git
# cd .; git ls-remote git://privateserver.com/path/to/myproject
fatal: remote error: 
  GitHub private mode is enabled. Git protocol is disabled. Use authenticated http or ssh access instead.
# cd .; git ls-remote https://privateserver.com/path/to/myproject
fatal: could not read Username for 'https://privateserver.com': terminal prompts disabled
# cd .; git ls-remote http://privateserver.com/path/to/myproject
fatal: could not read Username for 'https://privateserver.com': terminal prompts disabled
# cd .; git ls-remote git+ssh://privateserver.com/path/to/myproject
Permission denied (publickey).
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.
# cd .; git ls-remote ssh://privateserver.com/path/to/myproject
Permission denied (publickey).
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.
privateserver.com/path/to/myproject.git (download)
# cd .; git clone privateserver.com/path/to/myproject /home/matthewh/go/src/privateserver.com/path/to/myproject.git
fatal: repository 'privateserver.com/path/to/myproject' does not exist
package privateserver.com/path/to/myproject.git: exit status 128

get命令支持使用-insecure标志使用http,如下所示:

go get -insecure privateserver.com/path/to/myproject.git

默认值为安全HTTPS,以防止人员处于中间攻击,如Git Issue中所述

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM