git push每次都需要输入帐号密码的解决方法


有时候git明明已经配置了用户名和密码,但在项目中,有时候pull和push的时候却每次都要提示输入用户名和密码,很浪费时间。

解决办法

在git bash中输入:

git config --global credential.helper store

执行完上面的git命令后,在命令行正常执行pull ,push,如果是在以上操作完之后第一次执行pull push,需要输入一次用户名密码,以后不再需要输入。

第一次向新的URL输入用户名密码之后会发现 .git-credentials中追加了类似 https://username:password@hello.com的内容

vim查看home路径中的.gitconfig,会在之前

[user]
name =**********

email=***********

的基础上多出

[credential]
helper = store


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM