github设置ssh key后push还要输入用户名和密码解决方案

因为用的是https而不是ssh,更新originssh格式
HTTPS的格式为:https://github.com/用户名/仓库名.git
SSH的格式为:[email protected]:用户名/仓库名.git

git remote remove origin
git remote add origin [email protected]:用户名/仓库名.git

push的时候实际上是采用的SSH方式推送的代码。(打开config文件可以看到[remote "origin"]urlssh格式)。

猜你喜欢

转载自blog.csdn.net/zyddj123/article/details/85613825