Unable to push anything into a new repo
Asked by Michael Powell:

AFAIK, I have my SSH setup locally. I added the public key to the repo, and added BB's details to my known_hosts. AFAIK, now I somehow need to grant my credential 'admin' or even just 'write' access. Currently seems to be locked in with 'view' access only, which is unacceptable.  

Command line I do this to verify, which confirms my experience thus far:

<br />

$ ssh -T git@bitbucket.org  
authenticated via a deploy key.  
You can use git to connect to Bitbucket. Shell access is disabled.  
This deploy key has read access to the following repositories:  
\<username\>/\<repo\>  

Yet when I try to git push:  

$ git push -u origin trunk  
Warning: Permanently added the RSA host key for IP address '104.192.141.1' to the list of known hosts.  
Unauthorized  
fatal: Could not read from remote repository.  
Please make sure you have the correct access rights and the repository exists.  

What gives? How can this be? What do I need to verify? I can apparently clone the repository just fine, which I have done, but I cannot push.  

$ git remote -v  
origin git@bitbucket.org:username/repo.git (fetch)  
origin git@bitbucket.org:username/repo.git (push)  

Kind of stymied at the moment until this can be resolved.


Answers:
author: Michael Powell
body: Ah! Figured it out... I was adding my keys on the repo itself, as mentioned [in at least one other place](https://community.atlassian.com/t5/Bitbucket-questions/Push-no-longer-works-unauthorized/qaq-p/1227503), I was setting that key, and not the one on my account itself. I did that, and immediately, I could push.

comments: author: Samkelo
body: "not the one on my account itself." Where is the location of this key then. Which account you refering to here. I'd appreciate a bit of detailed response here because I'm having the same issue here.


author: Samkelo
body: I also followed the same instructions given in that link as well.


author: Michael Powell
body: Also, please note, I have multiple public keys going on for my Git. One to Github, another for here. Not sure if that could be confused. On W10 x64 WSL2, I copied from the *\~/.ssh/bitbucket_rsa.pub* and pasted into my BB access key as per the instructions, correct?


author: Michael Powell
body: To be clear, I added another repo and AFAIK it has the groups and membership as I might expect them. I can clone it okay, I even merged locally with an unrelated history. All good on my end AFAIK. Now, still getting the issue:

```
$ git push -u origin trunk
Unauthorized
fatal: Could not read from remote repository.
Please make sure you have the correct access rights and the repository exists.
```


author: Michael Powell
body: Further, after some exploring, I have added some admin and other groups, and associated myself in the admin group. Then connected that group with the project and with the repository, AFAIK. Now the project, etc, are no longer locked to me. However, I still cannot push from my Git client. Same sort of errors. I even pulled afresh to begin with, to no avail.


author: Michael Powell
body: Now when I try to add myself as an admin to the members, I am not getting any response, marching ants, if you will, after clicking confirm. Additionally, I see a locked icon next to the project. I'm sure this is not right, either; how can that be so? I created the project, why is it locked?


Tags: bitbucket-cloud

cloud