Cannot push to git repository - permission denied

You need to do in your console (if you use an a putty ssh client):

  1. Generate the keys, if keys not exist:

    cd ~/.ssh && ssh-keygen -lf ~/.ssh/id_rsa.pub
    

Don't forget password, entered at this step!

  1. Output your public key to screen:

    cd ~/.ssh && cat id_rsa.pub
    
  2. Copy this string by click and move a mouse pointer from begin output to end. No need to press Ctrl + V or any more keys.

  3. Log in your account on GitHub and add this public key to https://github.com/settings/ssh

  4. Now you can use your git locally.


I had the similar problem and my problem was solved by running the following command to add my key to the list of known keys:

ssh-add ~/.ssh/id_rsa

Hope it solves yours too. ;)