Cloned GitHub repos ask for a password, while originally created don't
My guess:
Your old repositories used SSH remotes ([email protected]:
or ssh://[email protected]/
prefixes), which used public-key authentication. (In fact, the Github SSH server never asks for a password.)
Your new repositories use HTTP remotes (https://username@github.com/
), which only support password-based HTTP Basic authentication and do not use your SSH keys.
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/username/repo.git
with just
[email protected]:username/repo.git
You can even have an entry in your ~/.gitconfig
that tells git to translate remote URLs from HTTP or Git to SSH.
This way, if your repository is configured for a HTTP or Git remote, git will ignore that setting when pushing and will use SSH instead.
[url "[email protected]:"]
pushInsteadOf = git://github.com/
pushInsteadOf = https://github.com/
(An insteadOf =
setting is also possible, to override both pulling and pushing.)