Skip to content

Instantly share code, notes, and snippets.

@Yemolai
Last active February 14, 2020 12:46
Show Gist options
  • Save Yemolai/3aabc1673b677bff52607c1c755083b7 to your computer and use it in GitHub Desktop.
Save Yemolai/3aabc1673b677bff52607c1c755083b7 to your computer and use it in GitHub Desktop.

Caching your GitHub password in Git

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

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.

1. In Terminal, enter the following:

$ git config --global credential.helper cache

To set git to use the credential memory cache

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

$ git config --global credential.helper 'cache --timeout=3600'

To set the cache to timeout after 1 hour (setting is in seconds)

From this document

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