Skip to content

Instantly share code, notes, and snippets.

@keith9820
Created July 13, 2016 21:20
Show Gist options
  • Save keith9820/ffb78a2527d0e37d0e4e3f1917571c25 to your computer and use it in GitHub Desktop.
Save keith9820/ffb78a2527d0e37d0e4e3f1917571c25 to your computer and use it in GitHub Desktop.
How to cache your git password

https://help.github.com/articles/caching-your-github-password-in-git/#platform-all

WINDOWS

If you're cloning repositories using HTTPS, you can use a credential helper to tell Git to remember your username and password every time it talks to the server.

If you clone repositories using SSH, then you authenticate using SSH keys instead of a username and password. For help setting up an SSH connection, see Generating SSH Keys.

Tip: You need Git 1.7.10 or newer to use the credential helper.

The credential helper is included with GitHub Desktop. The app also provides a Git shell so you won't ever need to install and configure Git manually. For more information, see "Getting Started with GitHub Desktop."

If you prefer working with the command line, you can also install a native Git shell, such as msysgit. With msysgit, running the following in the command line will store your credentials:

git config --global credential.helper wincred

All

If you're cloning repositories using HTTPS, you can use a credential helper to tell Git to remember your username and password every time it talks to the server.

If you clone repositories using SSH, then you authenticate using SSH keys instead of a username and password. For help setting up an SSH connection, see Generating SSH Keys.

Tip: You need Git 1.7.10 or newer to use the credential helper. Turn on the credential helper so that Git will save your password in memory for some time. By default, Git will cache your password for 15 minutes.

On the command line, enter the following:

git config --global credential.helper cache
# Set git to use the credential memory cache

To change the default password cache timeout, enter the following:

git config --global credential.helper 'cache --timeout=3600'
# Set the cache to timeout after 1 hour (setting is in seconds)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment