Monday, 25 September 2017

How to store your git credentials

Use the following command:
 git config --global credential.helper store
Next time when you will be prompted again your credentials, It will be created ".git-credentials" file in your home.
Now you never have to enter your credentials.

Storage format

The .git-credentials file is stored in plaintext. Each credential is stored on its own line as a URL like:
 https://<user>:<password>@<hostname>

Example

Store your password in your home.

1
2
3
4
5
6
7
8
$ git config --global credential.helper store
$ git push http://yourserver.com/repo.git
Username: <type your username>
Password: <type your password>

[several days later]
$ git push http://yourserver.com/repo.git
[your credentials are used automatically]

No comments:

Post a Comment

Welcome

Hello everybody, Welcome in my blog called "Information technology archive". Obviously the topics will be related to Informatio...