Caching your GitHub credentials in Git

A short article for someone like me who finds it annoying to enter Git username and password

Reference: github docsarrow-up-right

1. Turn on credential helper

$ git config --global credential.helper cache
  • credential helper stores the entered password.

  • By default, it's stored for 15 minutes, but if you want to change it, you can change the storage time with the command below

2. Change the default password cache timeout

 $ git config --global credential.helper 'cache --timeout 3600'
  • An hour - 3600

  • 1 day - 86,400

  • 7 days - 604,800

  • 30 days - 2,592,000

Last updated