解决生成ssh密匙后还需要输入密码

  • 2019 年 11 月 13 日
  • 笔记

问题

配置了centOS后每次git pull还需要输入密码

原因是当时添加仓库的是使用了https而不是git方式,所以需要更新origin

git remote remove origin  git remote add origin [email protected]:Username/Your_Repo_Name.git

注意上面添加的仓库地址形式是git@git_repo

之后还需要重新设置track branch,比如:

git branch --set-upstream-to=origin/master master

参考文章:https://blog.csdn.net/shahuhu000/article/details/86625987