3

I am pushing from my windows box to a repository cloned from an http (not ssh) address. Each push, I have to enter my u/p. I want to automate this process. I have tried the following:

$ git config credential.helper cache
$ git config credential.helper 'cache timeout=360000'

But those settings had no effect and I still have to enter the u/p each time. Is there any way to automate it?

Jonah
  • 15,225
  • 21
  • 83
  • 152

2 Answers2

7

Use _netrc file to store your username/password for remote machine, described here

Community
  • 1
  • 1
tomgi
  • 1,422
  • 11
  • 19
  • On my work machine the _netrc method would not work when placed into my profile C:\Users\Name.Domain. Moved to C:\Users\Name and it works. – SurfRat Jun 12 '13 at 06:30
2

Newer versions of Git support a more streamlined credentials API. Depending on implementation of the credentials helper, this is typically more convenient and secure than using .netrc.

A popular windows credentials helper is git-credential-winstore.exe. Simply download to the git/bin path and execute. Github supplies a similar helper.

Additional detail here (but not specific to Windows):

Community
  • 1
  • 1
kaliatech
  • 16,897
  • 4
  • 66
  • 81