Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Git push over HTTP asking for password twice [duplicate]

Tags:

git

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

like image 672
Pixoo Avatar asked Oct 27 '10 19:10

Pixoo


People also ask

Why is Git clone asking for a password?

If Git prompts you for a username and password every time you try to interact with GitHub, you're probably using the HTTPS clone URL for your repository. Using an HTTPS remote URL has some advantages compared with using SSH. It's easier to set up than SSH, and usually works through strict firewalls and proxies.

How do I resolve a Git authentication problem?

Generating a new Personal Access Token Provide the required permissions and create the access token. Copy this access token and Save it for future use. Now when trying to Authenticate with Git from the Bash, provide the Personal Access Token generated instead of the Password.

What happens if two people push to Git at the same time?

If server detects a conflict when someone pushes data (and if two users are doing this "simultaneously" one of the pushes will be conflicting, because it will be applied only after the other one completes), the server will reject it, and the unlucky user shall then resolve conflicts and try to push again.

What is Git_askpass?

Git Askpass for Windows (Askpass) provides secure Git credential storage for Windows. Askpass provides multi-factor authentication support for Azure DevOps, Team Foundation Server, and GitHub.


2 Answers

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:[email protected]/whatever.git with the following command:

git remote set-url origin http://myusername:[email protected]/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.

like image 104
Mark Longair Avatar answered Sep 20 '22 08:09

Mark Longair


What about you make an ssh connection without password to the git server? Ssh connection without password

like image 2
TheOneTeam Avatar answered Sep 20 '22 08:09

TheOneTeam