tags:

views:

260

answers:

1

I'm working with Git pushing changes to a repository shared over HTTP / WebDAV, and Git prompts for a password for every operation that accesses the HTTP remote. Is there any way to make Git cache the password / have the remote server not prompt me?

The remote webserver should be an Apache and could possibly be reconfigured if necessary.

+1  A: 

The way is to use ~/.netrc as outlined in step 3 of this Git documentation:

Then, add the following to your $HOME/.netrc (you can do without, but will be asked to input your password a lot of times):

machine <servername>
login <username>
password <password>

...and set permissions:

chmod 600 ~/.netrc
Sii
Also, don't include the user name in the URL for git, otherwise git won't consult `~/.netrc`.
robinst