按照Github官方设置ssh key的教程进行设置后,发现在进行git push时候任然需要输入账号和密码。
问题在于一开始进行git clone时候是使用https进行克隆

解决方法

  • 使用以下命令查看origin使用的是https还是ssh
    git remote -v
  • 如果使用的是https替换为ssh方式即可
    git remote set-url origin git@github.com:name/repo
  • 重新进行git push/pull 不再需要输入账号密码

参考stack overflow

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-12-30
  • 2022-12-23
  • 2021-07-20
  • 2022-12-23
  • 2022-12-23
  • 2022-02-07
  • 2022-12-23
相关资源
相似解决方案