3

When I want to merge my updates from development to production I am naturally running multiple git pull and git push commands to get the job done. For every single one of those commands Git will ask me for my password. (You may ask why I have to do multiple pull/push, well, just to make sure I include everything in case someone else pushed to my branch or production branch before me).

I want to avoid entering my password four times, I know there is a non-secure method to store credentials with Git, but that's not what I ask. What I ask is to enter my password just once and "magically" expect Git to remember it for a few seconds before it asks me again. Is there a built-in support for this or I have to do something on my own?

UPDATE: Quoting from my comment below :

I have tried git config --global credential.helper 'cache --timeout=300' and now if I run git config --global --edit I can see my config file having this line under [credential] : helper = cache --timeout=300. However, I try a dummy command git pull, enter password and git pull again, but I am asked for password again.

Any idea what is wrong ? My git version is 1.9.1 and I saw that the credential.helper is introduced in an earlier version.

George Dimitriadis
  • 1,681
  • 1
  • 18
  • 27
  • 5
    What version of git are you using? In recent versions the [credential manager](https://git-scm.com/book/en/v2/Git-Tools-Credential-Storage) will automatically cache your credentials so you won't be continuously prompted. – Cory Kramer Oct 03 '16 at 13:12
  • 1
    I am using 1.9.1. Interesting, is it a good idea to udate to 2.10 ? Are there many differences in the interface ? – George Dimitriadis Oct 03 '16 at 13:16
  • 2
    For the most part it works the same way `clone`, `push`, `pull`, `commit`, etc just as you'd expect. There are a few interface changes too summarized [here](https://felipec.wordpress.com/2014/05/29/git-v2-0-0/) and [here](http://blogs.atlassian.com/2014/06/happened-git-2-0-full-goodies/). – Cory Kramer Oct 03 '16 at 13:19
  • 2
    Thanks, I have tried `git config --global credential.helper 'cache --timeout=300'` and now if I run `git config --global --edit` I can see my config file having this line under [credential] : `helper = cache --timeout=300`. However, I try a dummy command `git pull`, enter password and `git pull` again, but I am asked for password again. This is weird. – George Dimitriadis Oct 03 '16 at 13:37
  • 2
    Possible duplicate of [Is there a way to skip password typing when using https:// on GitHub?](http://stackoverflow.com/questions/5343068/is-there-a-way-to-skip-password-typing-when-using-https-on-github) – Scott Weldon Oct 03 '16 at 16:53

0 Answers0