When I clone a repo with git clone https://[email protected]/directory or when I push to it with git push origin master
Git asks me for a password, how I can automatically provide the password, like ssh keys for example ? So that it don't asks me for my password anymore ?
I need this for two reasons:
1)automation, hudson for example
2)I'm too lazy to provide it everytime by myself
Second question (it's related with the first one)
Why they asks sometimes twice for the password ?
There is nothing like the SSH agent for http, so you have to provide the password in cleartext. You can save the credentials to
~/.netrc
:Note that the password is saved in clear text there. It is less secure than using encrypted SSH keys and ssh agent, but get's the job done. You are basically on the same security level as a default Subversion on most systems.
Note that newer versions of Git (> 1.7.0) make a better job of caching entered credentials, so you should only need to enter your password once there if you do not use the
.netrc
.