Linux git 记住密码

1. touch创建文件 .git-credentials

touch ~/.git-credentials

2. 编辑文件

vi ~/.git-credentials

# 按照此格式编辑文件 
# https://username:password@github.com

3. 在终端下执行

git config --global credential.helper store

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

[credential]
	helper = store

这样拉取代码和提交代码就不提示需要登录了

留下评论

您的电子邮箱地址不会被公开。 必填项已用 * 标注