linux保存git账号密码

 相信大家都会遇到git push提示输入账号密码,每次都要输入很麻烦,下面介绍如何长期保存账号密码

1、全局设置记住用户名和电子邮件:

git config --global user.name "your_username"
git config --global user.email "your_email@example.com"

2、使用凭证助手存储密码  

git config --global credential.helper store

之后,当你下一次使用Git并输入用户名和密码时,Git会将它们保存在~/.git-credentials文件中。后面git push就不会提示输入账号密码了

posted @ 2024-05-09 08:17  lucky_tomato  阅读(529)  评论(0编辑  收藏  举报