美文网首页
Linux下git 命令 免输密码设置

Linux下git 命令 免输密码设置

作者: 海阔天空的博客 | 来源:发表于2021-11-05 07:45 被阅读0次

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

cd ~
touch .git-credentials
vim .git-credentials

点击 “i” 进入编辑文件模式

https://{username}:{password}@github.com
例如 
https://zhang3:12345@github.com

点击“ESC” 然后输入“:wq”退出编辑并保存

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

可以看到

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

相关文章

网友评论

      本文标题:Linux下git 命令 免输密码设置

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