https://stackoverflow.com/questions/6565357/git-push-requires-username-and-password
A common mistake is cloning using the default (HTTPS) instead of SSH. You can correct this by going to your repository, clicking the ssh button left to the URL field and updating the URL of your origin remote like this:
git remote set-url origin [email protected]:username/repo.git
See http://stackoverflow.com/questions/7773181/git-keeps-prompting-me-for-password, make sure you are cloning your repos using ssh
:
ssh://[email protected]/username/repo.git
If you use https
or git
, you will always be asked for username/password:
https://github.com/username/repo.git
git://github.com/username/repo.git
From https://stackoverflow.com/questions/8588768/git-push-username-password-how-to-avoid, make sure your repo URL is in the form
git+ssh://[email protected]/username/reponame.git
as opposed to
https://github.com/username/reponame.git
To see your repo URL, run:
git remote show origin
You can change the URL with:
git remote set-url origin git+ssh://[email protected]/username/reponame.git