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

[INFO] --> Fetching github.com/xxx/yyy
Username for 'https://github.com':

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

git config --global --add url."git@github.com:".insteadOf "https://github.com/"

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

git clone git@github.com:xxx/yyy.git

文章来源:胡小旭 => 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.