Using SSH with Git Repositories
til
git
ssh
If you’ve setup your git account to use SSH, then should be pretty straightforward. My usual workflow was to git clone the URL of the repository, but I decided to use SSH instead because I was annoyed with having to always enter my credentials. This is how to do it.
Note:For the most part, I use GitHub but just replace github.com with whatever service you’re using.
Cloning a Repository
git clone [email protected]:<username>/<reponame>.git
Changing the Remote to Use SSH
If you’ve already cloned a repo without using SSH, then you can modify the branch to use SSH
git remote set-url origin [email protected]:<username>/<reponame>.git