windows:
1、在windows中添加一个HOME环境变量,变量名:HOME,变量值:%USERPROFILE%
2、进入%HOME%目录,新建一个名为"_netrc"的文件,文件中内容格式如下:
machine {git account name}.github.com
login your-usernmae
password your-password
重新打开git bash即可,无需再输入用户名和密码。
:
1、cd到git仓库目录
2、打开git配置文件:vim .git/config
3、在.git/config中添加以下配置项:
- [credential]
- helper = store --file /home/nginx/.git-credentials
- helper = cache --timeout 30000
4、编辑/home/nginx/.git-credentials文件为以下内容:
{git account name}.github.com