Problem
I am getting the below error while pushing or pulling data from bitbucket.
git fetch --all
Fetching origin
Forbidden
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
I have the same ssh keys on my ~/.ssh/project_ssh_key on bitbucket & my mac.
What I have tried to fix it
I tried to create a new ssh file and use the same using the below command.
eval "$(ssh-agent -s)"
ssh-add -K ~/.ssh/my_project_new_private_key
I have added the newly created key in bitbucket in ** Personal Settings --> ssh keys ** and pasted the public key but no luck.
I also tried ssh -T git@bitbucket & got the output as
logged in as chakreshwar
You can use git or hg to connect to Bitbucket. Shell access is disabled
Earlier everything was working with the old key before I did the below
1. I realized that my RoR application is not using **.ruby-version** & **.ruby-gemset**
2. I created a new gemset & use that gemset.
3. Move all the references from default to newly created gemset.
4. Bundle install and rails s to make sure everything works.
5. Delete all the old git branches from local which are no longer in use.