Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Had SSH key in repo, moved to personal and can't push

Burt Gordon March 6, 2023

I have seen similar problems, but not the same and none of the other post answers helped. Here's the situation:

* I accidentally added SSH access keys to a repo and not personal settings

* pulled a branch and created a branch from it, did some work

* Tried to push changes on new branch and got access errors, realizing that I had put the SSH keys in the repo

* Removed SSH key from repo and put them in personal settings

* Tried to push new branch to remote using "git push -u origin <new_branch_name>"

* Getting the following error:


The requested repository either does not exist or you do not have access. If you believe this repository exists and you have access, make sure you're authenticated.
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.


I can create a branch via the web browser (did a separate test branch), so i know I have the right permissions. I also used a command with ssh -vvv to see that it was using the proper key, which it was. So, it looks like I may have created a branch locally using a repo ssh key and now that I removed that key and added to my person settings I cannot upload the work to the repo. How do I recover the work and upload the branch given these circumstances?

1 answer

1 accepted

1 vote
Answer accepted
Burt Gordon March 6, 2023

Ahhh, I figured it out. I did have the right key but in the wrong account. I have two bitbucket accounts and accidentally added the key to the wrong account. I removed it from there and put it in the right one. The push then works and branch was properly created on the remote repo.

Suggest an answer

Log in or Sign up to answer
Site Admin
AUG Leaders

Atlassian Community Events