How to Change GitHub Remote from HTTPS to SSH?

By Hardik Savani June 1, 2021 Category : 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 [email protected]:{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 :