Menu & Search
Change Git Remote URL to SSH from HTTPS

Change Git Remote URL to SSH from HTTPS

This is a quick guide for if you’ve cloned a git repo via HTTPS and you want to change it to SSH.

This assumes SSH keys are set-up.

# Check Current Git URL
# Change Git URL (HTTP > SSH)

Check Current Git URL

First I’ll clone my repo using HTTPS. All remote actions will require the Git account password which is why you want to use SSH.

Then check the Git Remote URL.

git remote get-url origin

The URL begins with HTTPS so it’s clear to see what’s being used.

Change Git URL (HTTP > SSH)

Navigate to the repo link and select SSH.

Now amend the Git URL and check the status with a URL check & fetch.

git remote set-url origin <ssh-url>