Using git with ssh keys

Previously I have explored how would be the common way of pushing (uploading) changes to your repository. However in many instances we require to test our code in Linux/Unix platforms. Usually once I finish testing my code in Linux I will have to drag and drop to my changed files to my current Windows repo folder and then push the changes. I have been doing this because pushing code directly from linux becomes a little annoying because I had to type my username and password every single time I push changes.

If you want to avoid this from the very beginning, you will have to clone your repository using ssh. By default whenever you clone a repository it is done through https, and, if later you want to use ssh you will require change the remote url utilized for syncronizing your repository.

1. Check if you have cloned your repository as https
cd repository_folder
git remote -v


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