因为我换了电脑,git重新生成了ssh key然乎也add到了githup上面但是每次push和pull都需要输入用户名和密码无语中然后百度了好多都是
cd ~
vim .git-credentials
然后在打开的配置文件中加入 https://usercode:password@github.com
其中usercode就是您的用户名 password就是对应你的密码
git config --global credential.helper store
然后,下次再输入一次 账号密码 就可以了。
但是在我电脑上就是不管用,后来找到另一种解决办法如下:
$ ssh-keygen -p
如果原来有密码需要先输入旧密码,当提示你输入新的密码的时候,按enter就可以啦,继续确认enter就可以
Enter file in which the key is (/Users/never/.ssh/id_rsa):
Enter old passphrase: (注:此处需要输入旧密码)
Enter new passphrase (empty for no passphrase): (注:此处直接Enter)
Enter same passphrase again: (注:直接Enter)
Your identification has been saved with the new passphrase