Windows:
Windows上设置避免每次git push 都需要账号密码
在 C:\Users\yangshiqiang 目录下 能看到 [.gitconfig] 这个文件:
[user]
name = yang****
email = ************.com
[credential]
helper = store
配置了credential之后就可以存储账号密码,下次不用再输入
linux上设置避免每次git push 都需要账号密码
先cd到根目录,执行git config --global credential.helper store命令
[root@yangshiqiang ~]# cd/
[root@yangshiqiang ~]# git config --global credential.helper store
执行之后会在.gitconfig文件中添加你的名字跟账号
[user]
name = yangshiqiang
email = xxxx@xxxx.com
[credential]
helper = store
进入一个git拉取的项目中
在项目下执行命令
git config --global credential.helper store
在拉取代码
[root@yangshiqiang ~]# git config --global credential.helper store
[root@yangshiqiang ~]# git pull