最族
GIT免除pull/push时输入账号密码
2017-12-5 Veris


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用户名和密码存储文件



3. git bash进入%HOME%目录,新建一个名为"_netrc"的文件,内容如下:


machine {git account name}.github.com
login your-usernmae
password your-password
发表评论:
昵称

邮件地址 (选填)

个人主页 (选填)

内容