Skip to content

Instantly share code, notes, and snippets.

@Yash089610
Forked from ankurk91/git_remember_password.md
Created January 9, 2019 17:24
Show Gist options
  • Save Yash089610/d695ca57e0fbf3fe538bd5a3a1990af7 to your computer and use it in GitHub Desktop.
Save Yash089610/d695ca57e0fbf3fe538bd5a3a1990af7 to your computer and use it in GitHub Desktop.
Git credential cache, why type password again and again

Git tip: Tired of entering password again and again ?

Run this command to remember your password:

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

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

How to make git forget this password ?

If you want to switch to another github account then u can 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 are on a shared computer)

git config --system --unset credential.helper

Ref: 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