Skip to content

Instantly share code, notes, and snippets.

@ludoo0d0a
Created September 4, 2017 20:24
Show Gist options
  • Save ludoo0d0a/31b578d7fe8a05d8b1e8debc3bc81c08 to your computer and use it in GitHub Desktop.
Save ludoo0d0a/31b578d7fe8a05d8b1e8debc3bc81c08 to your computer and use it in GitHub Desktop.
github ssh keys AND no password

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment