GIT更换连接方式

Posted zhangguorenmi

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了GIT更换连接方式相关的知识,希望对你有一定的参考价值。

1-使用 git remote -v 查看对应的克隆地址:

 

git remote -v
origin  https://github.com/username/repository.git (fetch)
origin  https://github.com/username/repository.git (push)

 

可以看到确实是以https方式clone的


2-删除并重新添加:

 

git remote rm origin
git remote add origin git@github.com:username/repository.git

 

3-push一下

git push -u origin master

 

以上是关于GIT更换连接方式的主要内容,如果未能解决你的问题,请参考以下文章