Blogging about technology and photography

Changing a GitHub repository origin from HTTPS to SSH

If a repository is cloned using the HTTPS URL instead of the SSH URL, there will be a prompt for a GitHub username and password. If the SSH URL is used then there will be no prompt for a password if SSH is already set up on GitHub.

You can check what is being used, (HTTPS or SSH), with the following code in Terminal:

git remote -v

To change the repository origin replace USERNAME with the username and REPOSITORY with the repository name when using the following code: