开发者

Git push over HTTP asking for password twice [duplicate]

This question already has answers here: Is there a way to cache https credentials for pushing commits? 开发者_如何学Python (28 answers) Closed 9 years ago.

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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜