Git push over HTTP asking for password twice [duplicate]
I managed to make git work for pull and push over http. Now the last step it getting around the git push asking twice for my password. I don't want to use the .netrc file. any idea ? thanks
Update: There's a better solution in git now, which I described in answer to this other question:
- Is there a way to skip password typing when using https:// on GitHub?
I've kept the old answer I wrote below for reference.
If you don't want to use .netrc
, another option is to specify your username and password in the URL that your remote refers to, e.g. if your origin
remote is:
http://some.server/whatever.git
... you could change it to http://myusername:mypassword@some.server/whatever.git
with the following command:
git remote set-url origin http://myusername:mypassword@some.server/whatever.git
... and you won't need to enter your password manually. This does mean that your password will be stored in plain text in your .git/config
file, however. If this is a problem, you're better off using public key based authentication with SSH.
What about you make an ssh connection without password to the git server? Ssh connection without password
精彩评论