Linux 如何省去git记忆用户名和密码输入

Run the following command:
$ mkdir ~/.git-credentials
$ git config --global credential.helper store
$ git config --global credential.helper `store --file=~/.git-credentials/git.credentials` --add


Then, try to use git push to push some code, it should ask you to enter the username and password. Don’t worry, it just needs for once.

You can check your credentials storage by the following command:

$ vim ~/.git-credentials

也可以直接编辑该文件:

http://username:[email protected]

再运行:

$ git config --global credential.helper store

猜你喜欢

转载自blog.csdn.net/newtelcom/article/details/80339047