Enable caching of Git credentials in memory

By default, Git does not cache credentials. After enabling credential caching in Git, your username and password will be cached in memory for some amount of time.

This will allow you to avoid having to re-enter your username and password every time there is a connection using the HTTP protocol. The following will enable caching.

$ git config --global credential.helper cache

After it is enabled, Git will cache your credentials for 15 minutes by default. However, this can be modified by passing the --timeout flag.

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

The above will tell Git to cache your credentials for 7,200 seconds (2 hours)

more Git posts