> 技术文档 > git 设置保存密码 git保存密码_git保存用户名和密码

git 设置保存密码 git保存密码_git保存用户名和密码

目录

长久保存密码


长久保存密码

git push和git pull都能使用。

git config --global credential.helper store

然后执行一次 git pull,Git 会提示输入用户名和密码,

输入后保存路径:

 ~/.git-credentials ,

Windows系统:

(Windows 在 C:\\Users\\你的用户名\\.git-credentials)。

示例: 文件内容如下:
https://your-username:your-password@github.com