Skip to content

Instantly share code, notes, and snippets.

@andstor
Last active October 13, 2018 14:09
Show Gist options
  • Save andstor/f27584d3a39be9c68b58dbdb3e84d83a to your computer and use it in GitHub Desktop.
Save andstor/f27584d3a39be9c68b58dbdb3e84d83a to your computer and use it in GitHub Desktop.
Git credential cache, no more repeating passwords!

Command for remembering your password:

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

Above command will tell git to cache your password for 8 hours.

Make git forget this password

Switch to another github account, run this command

git credential-cache exit

Above command will flush any stored password from cache.


Reference: http://git-scm.com/docs/git-credential-cache

Windows User

git config --global credential.helper wincred

Ref for Windows: http://stackoverflow.com/questions/11693074/git-credential-cache-is-not-a-git-command

Mac OS user

Remove keychain from storing your password (when you're on a shared computer)

git config --system --unset credential.helper

Reference: https://stackoverflow.com/questions/16052602/disable-git-credential-osxkeychain

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