当使用glide install安装go的依赖包时,会提示:

[code lang=”shell”]
[INFO] –> Fetching github.com/xxx/yyy
Username for ‘https://github.com’:
[/code]

此时,可以使用git config –add参数进行地址替换,具体命令如下:

[code lang=”shell”]
git config –global –add url."git@github.com:".insteadOf "https://github.com/"
[/code]

之后,再使用glide install安装依赖包时,会使用如下形式的命令进行下载代码:

[code lang=”shell”]
git clone git@github.com:xxx/yyy.git
[/code]


文章来源:胡小旭 => Git之替换代码库HTTP(s)地址路径成Git协议路径

Share:

Leave a Reply

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.