问题
- git 提交时,每次都需要输入用户名、密码
解决
- 使用了https协议的缘故,换成ssh协议就好了
$ git remote -v
origin https://github.com/AdeGitHub/hello-world.git (fetch)
origin https://github.com/AdeGitHub/hello-world.git (push)
- 删除https,改为ssh协议
$ git remote rm origin$ git remote add origin git@github.com:AdeGitHub/hello-world.git
本文解决了一个常见的Git使用问题:每次提交时都需要手动输入用户名和密码。通过将远程仓库从HTTPS协议切换到SSH协议,可以避免这一繁琐步骤,提升工作效率。具体操作包括查看现有配置、删除HTTPS远程仓库并重新添加为SSH形式。
9093

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



