Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Troubleshooting git push - it asks for a user/pass

Tags:

git

github

I'm using git on a new git linux computer. When I do git push, it me asks for user/password.

I've setup git properly, and in fact cloning the repo from github into a new folder works perfectly (using my public key, not the readonly copy). When I try to push from a previous clone I made to the same repo I get prompted for a user/pass.

Of course sshing into [email protected] works, and I made sure my public key is configured in github. Any ideas how to continue debugging?

like image 268
ripper234 Avatar asked Apr 28 '11 04:04

ripper234


People also ask

Why is git push asking for 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.

How do I get git to stop asking for my username?

To prevent Git from asking for your username and password, you can enter the login credentials in the URL as shown. The main drawback of this method that your username and password will be saved in the command in the Shell history file.

Why is push not working in git?

If git push origin master not working , all you need to do is edit that file with your favourite editor and change the URL = setting to your new location. Assuming the new repository is correctly set up and you have your URL right, you'll easily be able to push and pull to and from your new remote location.

How do I avoid the specification of the username and password at every git push?

Copy public key from specified file. Go to your GitHub profile => Settings => SSH and GPG keys => New SSH key => Paste your SSH key there => Save.


1 Answers

this occurs because you did

git clone https://github.com/username/repo 

instead of

git clone [email protected]:username/repo.git 
like image 88
mihaicc Avatar answered Oct 02 '22 21:10

mihaicc