https方式每次都要输入密码,按照以下设置便可输入一次就不用再手输入密码的困扰并且又享受https带来的极速git
设置记住密码(默认15分钟):ssh
git config --global credential.helper cache
若是想本身设置时间,能够这样作:spa
git config credential.helper 'cache --timeout=3600'
这样就设置一个小时以后失效.net
长期存储密码:code
git config --global credential.helper store
增长远程地址的时候带上密码也是能够的。(推荐)orm
http://yourname:password@git.oschina.net/name/project.git
补充:使用客户端也能够存储密码的。ci
若是你正在使用ssh并且想体验https带来的高速,那么你能够这样作: 切换到项目目录下 :rem
cd projectfile/
移除远程ssh方式的仓库地址it
git remote rm origin
增长https远程仓库地址import
git remote add origin http://yourname:password@git.oschina.net/name/project.git