我记得以前不用啊,是不是哪里搞错了?
在添加远程库的时候使用了https的方式。。所以每次都要用https的方式push到远程库,速度还慢。。
查看使用的传输协议:
git remote -v
重新设置成ssh的方式:
git remote rm origin
git remote add origin git@github.com:username/repository.git
git push -u origin master
git config --global credential.helper "store"
配置好后在 .gitconfig 文件中可以看到
git config --global credential.helper store
我每次都要输入用户名和密码。如果上传的代码没有README.md,而GitHub上勾选添加了README.md的话,这时需要执行git pull origin master
和git push -u origin master
才能将代码push。