正常情况下通过 git config --list 对git配置进行查看,如果没有配置则通过命令配置即可
git config --global user.name 'name1'
git config --global user.password '123456'
git config --global user.email 'name1@qq.com'
以上配置仅针对服务器域名为为http开头
如果遇上域名为https加密开头的 以上设置就是个摆设了。必须在服务器根目录执行
git config --global credential.helper store
配置存储模式
执行完成之后在服务器主目录的.gitconfig文件中多个 helper = store
执行查看命令
vim ~/.gitconfig
然后再到你的项目目录执行对应的git commit命令 ,会提示你输入账号和密码,这次输入后就就自动记住你的账号和密码,并且会生成一个.git-credentials文件 在下一次执行更新提交时就不需要再熟人账号和密码了