Login Github for Pushing Code

For the reason that I don’t want to enter my username and password again and again just for push code to github I’m sick of this , I learn that there is a way to store credentials for Git in the local file.

Turn on Credentials Store

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.

Now you can push code to Cloud without entering the username and password , enjoy 🙂

Manage your Credentials

You can check your credentials storage by the following command:

$ vim ~/.git-credentials/git.credentials
分类: Git

1 条评论

git凭证存储 – Speak Softly Love · 2017年9月6日 下午7:47

[…] TripleZ's blog […]


电子邮件地址不会被公开。 必填项已用*标注

验证码 *