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

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

posted @ 2018-01-17 23:44  桔子木木  阅读(1525)  评论(0编辑  收藏  举报