1.在每次push 的时候,都要输入用户名和密码,很是麻烦原因是使用了https方式 push,在termail里边输入 git remote -v
可以看到形如一下的返回结果
origin https://github.com/wei0long/AugmentedReality.git (fetch)
origin https://github.com/wei0long/AugmentedReality.git (push)
下面把它换成ssh方式的。
git remote rm origin
git remote add origin git@github.com:wei0long/AugmentedReality.git
git push origin
2.可能这样还不行,还应该添加SSH公匙。
还有一种方法保持https不变,使用下面的命令
设置记住密码(默认15分钟):
git config –global credential.helper cache
如果想自己设置时间,可以这样做:
git config credential.helper ‘cache –timeout=3600’
这样就设置一个小时之后失效
长期存储密码:
git config –global credential.helper store
参考来源