Author:
Setup Origin⚓︎
This guide helps you change your Git remote origin from HTTPS to SSH.
Check Current Remote URL⚓︎
The command below shows your current remote URL:
The output can be:
terminal
>>> origin https://github.com/<your-username>/your-repo.git (fetch)
>>> origin https://github.com/<your-username>/your-repo.git (push)
Get GitHub SSH URL⚓︎
On GitHub, navigate to your repository page. Click on the green "Code" button, then select "SSH" to copy the SSH URL:
Set origin to SSH⚓︎
Now, set the remote URL to the SSH URL you copied:
Confirm the Change⚓︎
Check the remote URL again:
The output should now be:
terminal
origin git@github.com:<your-username>/your-repo.git (fetch)
origin git@github.com:<your-username>/your-repo.git (push)
Test SSH Connection⚓︎
If successful, you should see: