> For the complete documentation index, see [llms.txt](https://chloe-codes1.gitbook.io/til/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://chloe-codes1.gitbook.io/til/git/caching_your_github_credentials_in_git.md).

# 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 docs](https://docs.github.com/en/github/using-git/caching-your-github-credentials-in-git)

<br>

### 1. Turn on credential helper

```bash
$ 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

<br>

### 2. Change the default password cache timeout

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

* An hour - 3600
* 1 day - 86,400
* 7 days - 604,800
* 30 days - 2,592,000
