Git push troubleshooting - it asks for user / password

I am using git on a new git machine. When I do git push , it asks for user / password.

I installed git correctly, and actually cloning the repo from github to a new folder works fine (using my public key, not just read-only). When I try to push from a previous clone that I made for the same repo, I get a request for user / pass.

Of course, sshing on git @ github.com works, and I made sure my public key is configured on github. Any ideas on how to continue debugging?

+47
git github
Apr 28 2018-11-11T00:
source share
5 answers

What do you mean by previous repo? Check the source URL from the previous repo .git/config file. If you cloned using http, it will ask the user / pass.

+45
Apr 28 '11 at 4:59 a.m.
source share

it happens because you did

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

instead

 git clone git@github.com:username/repo.git 
+78
Apr 19 '12 at 7:27
source share

Try the following:

git source for remote installation of url [your git url, for example git @ github.com: ... / project.git]

+51
May 14 '12 at 10:38
source share

if your url repo: https://github.com/abc/xyz.git

set url from command line as: git remote set-url origin git@github.com:abc/xyz.git

Replace https://github.com/ with git@github.com:

+7
Oct 19 '14 at 6:09
source share

for mac If you have git 1.7.10+, credential-osxkeychain must be used to cache passwords. Here is a good explanation:

https://help.github.com/articles/set-up-git

+2
Jul 13 2018-12-12T00:
source share



All Articles