1
0
mirror of https://github.com/jbranchaud/til synced 2026-01-04 23:58:01 +00:00

Add Caching Credentials as a git til.

This commit is contained in:
jbranchaud
2015-09-28 21:17:54 -05:00
parent 4a1e1fa552
commit 1c3b7623aa
2 changed files with 24 additions and 0 deletions

View File

@@ -0,0 +1,23 @@
# Caching Credentials
When public key authentication isn't an option, you may find yourself typing
your password over and over when pushing to and pulling from a remote git
repository. This can get tedious. You can get around it, though, by
configuring git to cache your credentials. Add the following lines to the
`.git/config` file of the particular project.
```
[credential]
helper = cache --timeout=300
```
This will tell git to cache your credentials for 5 minutes. Use a much
larger number of seconds (e.g. 604800) to cache for longer.
Alternatively, you can execute the command from the command line like so:
```bash
$ git config credential.helper 'cache --timeout=300'
```
[source](http://git-scm.com/docs/git-credential-cache)