Linux和 Mac下git pull/push 免输入密码和账号

Posted 邹喆

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Linux和 Mac下git pull/push 免输入密码和账号相关的知识,希望对你有一定的参考价值。

linux下面可以直接创建.git-credential文件,命令如下:

创建文件,进入文件,输入内容:

cd ~
touch .git-credentials
vim .git-credentials
https://{username}:{password}@github.com

在终端下输入:

git config --global credential.helper store

打开~/.gitconfig文件,会发现多了一项:

[credential]
helper = store

注:设置好后第一次执行需要输入,以后就不需要了

以上是关于Linux和 Mac下git pull/push 免输入密码和账号的主要内容,如果未能解决你的问题,请参考以下文章