ItSolutionStuff.com

How to Change GitHub Remote from HTTPS to SSH?

By Hardik Savani • June 1, 2021
Git

Hello,

This tutorial shows you how to switch remove https to ssh. This article goes in detailed on github change remote https to ssh. you will learn github change https to ssh. i would like to share with you change github repo from https to ssh. you will do the following things for command to change https to ssh git repo.

i will give you simple "git remote set-url {repo_path}" command to change https to ssh url. basically, when you are using https then you must need to add username and password each time on pull and push request to github. but if you use ssh then you don't need to add username and password each time.

let's see how to switch github remote from https to ssh url.

you can check which remote url now available in your project by using bellow command:

git remote -v

it will give you layout like as bellow:

origin http://github.com/{USERNAME}/{PROJECTNAME}.git (fetch)

origin http://github.com/{USERNAME}/{PROJECTNAME}.git (push)

now you can change by using following command:

Change Remote from HTTPS to SSH:

git remote set-url origin git@github.com:{USERNAME}/{PROJECTNAME}.git

now it will changed.

you can also check by git remote -v command.

i hope it can help you.

thank you.

Tags: Git
Hardik Savani

Hardik Savani

I'm a full-stack developer, entrepreneur, and founder of ItSolutionStuff.com. Passionate about PHP, Laravel, JavaScript, and helping developers grow.

📺 Subscribe on YouTube

We Are Recommending You

Solved - fatal remote origin already exists - Git

Read Now →

How to Merge Your Branch to main Branch in Github?

Read Now →

Git Command to Ignore File Permission Changes

Read Now →

How to Add Git Add Remote Origin on Bitbucket Repository?

Read Now →

Git - How to Find a Deleted File in Commit History?

Read Now →

How to Configure Git Username and Email?

Read Now →

Git - error failed to push some refs to git resolve - Solved

Read Now →

How to Git Force Pull from Remote Branch?

Read Now →

Git Remove Last Commit from Local Example

Read Now →

How to remove current changes from local system in Git ?

Read Now →