Skip to content

Instantly share code, notes, and snippets.

@ludoo0d0a
Created September 4, 2017 20:24
Show Gist options
  • Star 4 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • 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 git@github.com: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://git@github.com/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://git@github.com/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://git@github.com/username/reponame.git
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment