🔥Limited Offer: Get 50% OFFon AI & Full Stack Courses🔥
Back to Git Notes
Topic #21

GitHub Set Remote


Change Platform:


Set GitHub Remote Origin

Now that your SSH key is added to GitHub, you can securely connect your local repository to GitHub using SSH.

Test Your SSH Connection

First, test that your SSH connection to GitHub works:

Example

ssh -T git@github.com
The authenticity of host 'github.com (140.82.121.3)' can't be established.
RSA key fingerprint is SHA256:nThbg6kXUpJWGl7E1IGOCspRomTxdCARLviKw6E5SY8.
Are you sure you want to continue connecting (yes/no/[fingerprint])? yes
Warning: Permanently added 'github.com,140.82.121.3' (RSA) to the list of known hosts.
Hi your-username! You've successfully authenticated, but GitHub does not provide shell access.

If the last line contains your username on GitHub, you are successfully authenticated!


Get Your Repository's SSH Address

On GitHub, go to your repository and click the Code button. Make sure SSH is selected, then copy the SSH URL (it starts with git@github.com:):

GitHub Get SSH Code


Add or Update the Remote Origin

To add the remote origin (first time):

Example

git remote add origin git@github.com:your-username/your-repo.git

To update an existing remote to use SSH:

Example

git remote set-url origin git@github.com:your-username/your-repo.git

Congratulations! You are now ready to use GitHub with SSH.

Want to go beyond the notes?

Join CodingNow 2.0's Git course — live mentorship, real projects, and 100% placement support.

Enroll Now — Free Demo Available

GitHub Set Remote – FAQs

Quick answers about learning GitHub Set Remote in Git.

This free note from CodingNow 2.0 explains GitHub Set Remote in Git — concept, syntax and worked code examples you can copy, run and revise before interviews.
Yes. Every Git topic on CodingNow 2.0, including GitHub Set Remote, is 100% free with no signup required.
With focused practice, most students grasp GitHub Set Remote in 1–3 days from these notes; pairing it with CodingNow 2.0's mentor-led course takes you to job-ready depth faster.
Use the code examples in this note, then ask doubts for free on the CodingNow 2.0 Community (/community) — expert instructors answer within 24 hours.
WhatsApp
Call NowEnroll Now