Permission denied to git repo pushing
Sometimes we have an error like below when we try to push on Github.
Try to check where is your ssh key is being used by the following command:
ssh -T -ai ~/.ssh/id_rsa git@github.com
You will get a response like this:
So, in my case, my ssh key was being used by my other GitHub account. Now you have 2 choices.
- Remove ssh key from another account and add it to your account where you are trying to push
- Generate a new ssh key and use it.
I did 1st as It was not needed for my other account.