Git提交记住用户名和密码

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/yhc166188/article/details/84614670

每次提交代码都要输入用户名密码,十分麻烦,教大家怎么让Git记住密码。

Https记住密码
永久记住密码
git config --global credential.helper store
会在用户主目录的~/.gitconfig文件中生成下面的配置。

[credential]
    helper = store
如果没有--global,则在当前项目下的.git/config文件中添加。

当然,你也可以直接复制上面生成的配置到配置文件中。

临时记住密码
默认记住15分钟:

git config –global credential.helper cache
下面是自定义配置记住1小时:

git config credential.helper ‘cache –timeout=3600’
 

git密码记录的文件在用户主目录~/.git-credentials ,也可以手动配置,在这里我就不展示了。

merge冲突提交方法

gir reset  b7f7e1940b2e88afd2f6045cbba8cac0a1a319c   commitID 你提交的ID

git checkout   -f  

git fetch

git rebase origin/master

git push origin

猜你喜欢

转载自blog.csdn.net/yhc166188/article/details/84614670