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:

 git remote set-url origin 


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s