I've just lost a bunch of repositories from my disk, so I've cloned them from GitHub. These are now asking for username and password each time I push something to GitHub. Those that haven't been deleted don't do that.
The only solution I've read for getting rid of username/password prompt is generating ssh key. The thing is I already have a key, otherwise I couldn't push without prompts in those repos, that I didn't clone.

I've looked at git config for two of my repositories, one that I can push without password and one that I've cloned. The only difference was branch.master.remote and branch.master.merge settings, which I unset, making git config the same. But the prompt is still there.

I'm not even sure that generating new ssh key will work. What are my options?

link|improve this question
Please see help.github.com/ssh-issues and give more details. What happens when you try to SSH? – Gryllida Dec 3 '11 at 2:37
feedback

1 Answer

up vote 1 down vote accepted

My guess:

Your old repositories used SSH remotes (git@github.com: or ssh://git@github.com/ prefixes), which used public-key authentication. (In fact, the Github server does not even ask for a password – it immediately refuses any other authentication type.)

Your new repositories use HTTP remotes (https://username@github.com/), which only support password-based HTTP Basic authentication.

Change your remote URLs to use SSH again. Use git remote set-url or edit .git/config to do this – replace

https://username@github.com/

with just

git@github.com:
link|improve this answer
Yes, that was it! Thanks! – usr Dec 3 '11 at 14:02
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.