在使用git fetch远程仓库时,使用了https协议。
需要确认具体协议可以使用$git remote -v查看。
如看到像下面一样使用‘https://’这种引用,则说明使用了https协议。
origin https://github.com/FireWithFire/testRepository.git (fetch)
origin https://github.com/FireWithFire/testRepository.git (push)
此时,需要将协议调整为使用SSH协议。
具体操作如下:
—>删除origin:git remote rm origin
—>重新增加origin:git remote add origin git@github.com:username/repository.git
—>提交:git push -u origin master
本文介绍如何将Git远程仓库从HTTPS协议切换到SSH协议,包括删除原有远程连接、添加新的SSH连接及推送更新。
2297

被折叠的 条评论
为什么被折叠?



