SSH key exists not to make our life harder but so much simpler. Yes yes, you will see !
If you end up here it’s probably because you encountered a problem like : Permission denied (publickey) fatal : Could not read from remote repository
.
Let’s see how to solve that ! First, a quick recap on SSH key. SSH key are key generated by your computer that you enter in a remote service so that it knows that it’s yours and attribute the right permission to it. It’s like a computer ID for git.
To add SSH key to your favorite git manager follow the steps (before all of that you need to have git install on your computer) :
ssh-keygen
, press enter.ssh
(it’s a hidden folder), open the file id_rsa.pub
. If you have VSCode and working command you can just type :
code {chosenDirectory}/.ssh/id_rsa.pub
Key
section.That’s it ! You successfully added a SSH key to your Git provider ! You will now be able to pull and push without errors !