红联Linux门户
Linux帮助

git pull/push时候总提示输入账号密码-免除设置

发布时间:2016-02-25 15:28:02来源:linux网站作者:guang11cheng

linux下:

1.在~/下, touch创建文件 .git-credentials, 用vim编辑此文件,输入:

https://{username}:{password}@github.com

注意去掉{}

2.在终端下执行  git config --global credential.helper store

3.可以看到~/.gitconfig文件,会多了一项:
[credential]
helper = store


windows下:
1.添加一个HOME环境变量,变量名:HOME,变量值:%USERPROFILE%

2.创建git用户名和密码存储文件
git bash进入%HOME%目录,新建一个名为"_netrc"的文件,内容如下:
machine {git account name}.github.com
login your-usernmae
password your-password


本文永久更新地址:http://www.linuxdiyf.com/linux/18389.html