Skip to content

Instantly share code, notes, and snippets.

@AMD-NICK
Created August 12, 2018 15:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save AMD-NICK/390e175f83bbb054fdd89bae82d8f710 to your computer and use it in GitHub Desktop.
Save AMD-NICK/390e175f83bbb054fdd89bae82d8f710 to your computer and use it in GitHub Desktop.
Permanently authenticating with Git repositories

Run following command to enable credential caching:

$ git config credential.helper store
$ git push https://github.com/repo.git

Username for 'https://github.com': <USERNAME>
Password for 'https://USERNAME@github.com': <PASSWORD>

Use should also specify caching expire,

git config --global credential.helper 'cache --timeout 7200'

After enabling credential caching, it will be cached for 7200 seconds (2 hour).


Source: https://stackoverflow.com/questions/6565357/git-push-requires-username-and-password

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment