在提交项目代码或者拉代码的时候,git会让你输入用户名密码,解决方案:(我们公司用的是gitlab)
执行git config --global credential.helper store命令
![](https://images2015.cnblogs.com/blog/453030/201703/453030-20170310173728967-292798980.png)
然后git push origin your-branch
会让你输入用户名和密码,这时你输入就好了,然后下次再git push /pull 的时候就不用密码了~可发现下图两次的对比
![](https://images2015.cnblogs.com/blog/453030/201706/453030-20170629145803211-1123171442.png)
检验方式:C:\Users\你的电脑名; 这个文件夹(如下)下面是否能找到.git-credentials文件,如果文件的内容是有关你的gitlab的设置,格式为:http://{用户名}:{密码}@{git 网址}
![](https://images2015.cnblogs.com/blog/453030/201703/453030-20170310173745264-652347899.png)