From:http://www.g2w.me/2013/10/cache-github-credential-for-https-repository/
git config --system 配置全局 对应/root/.gitconfig文件
git config --global 配置当前用户 对应
git config 配置当前版本库 对应版本库下.git/config
git config user.name <username> git config user.email <email> git config core.editor vim git config core.color auto
配置http仓库密码
使用http地址访问仓库时,每次进行push操作都会提示输入用户名和密码,比较麻烦。可以进行配置。
对于1.7.9及之后的版本
git config --global credential.helper cache
如果需要加上失效时间,可以如下配置
git config credential.helper ‘cache --timeout=3600‘
则密码会在1小时后失效
对于1.7.9之前的版本
需要显式的在git地址中加入用户名和密码,如https://you:password@github.com/you/example.git
git config remote.origin.url https://you:password@github.com/you/example.git
原文:http://www.cnblogs.com/xiaoerlang/p/3595586.html