Skip to content

Instantly share code, notes, and snippets.

@BolajiAyodeji
Last active March 2, 2019 21:55
Show Gist options
  • Save BolajiAyodeji/c6422a5b8ad6264daf0a4c49589ff5b9 to your computer and use it in GitHub Desktop.
Save BolajiAyodeji/c6422a5b8ad6264daf0a4c49589ff5b9 to your computer and use it in GitHub Desktop.
How to fix git always asking for username and password

Update the URL of origin remote like, using SSH instead HTTPS;

git remote set-url origin git@github.com:username/repo.git

You can also use;

git config --global credential.helper store

to make git store the username and password and it will never ask for them.

You can save the username and password for a session (cache it);

git config --global credential.helper cache

You can change the timeout for above setting using;

git config --global credential.helper 'cache --timeout=600'

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