美文网首页
Linux下 保存 git账号密码

Linux下 保存 git账号密码

作者: Mr老朝 | 来源:发表于2021-07-12 12:14 被阅读0次

一、通过文件方式

1.在~/目录下, touch创建文件 .git-credentials, 用vim编辑此文件,输入内容格式:

touch .git-credentials
vim .git-credentials

在里面按“i”然后输入: https://{username}:{password}@github.com

比如 https://account:password@github.com

2. 在终端下执行

git config --global credential.helper store

可以看到~/.gitconfig文件,会多了一项:

[credential]
helper = store

3、密码更改后需要清除账号密码,执行

git config --system --unset credential.helper

相关文章

网友评论

      本文标题:Linux下 保存 git账号密码

      本文链接:https://www.haomeiwen.com/subject/ecprpltx.html