. 在~/目录下, touch创建文件 .Git-credentials

cd ~
touch .git-credentials
vim .git-credentials
点击 “i” 进入编辑文件模式

https://{username}:{password}@github.com
例如
https://zhang3:12345@github.com
点击“ESC” 然后输入“:wq”退出编辑并保存

在终端下执行
git config --global credential.helper store
可以看到~/.gitconfig文件,会多了一项:
vi .gitconfig
可以看到

[credential]

helper = store

再次执行 git命令
只需要输入1次 正确的账号和密码 以后可以直接跳过输入账号密码了

标签: none

添加新评论