1

I've seen, amongst many other things, this link and I can test ssh access with a successful outcome.

I can pull happily, however I cannot push due to the error

$ git push 
Unauthorized
fatal: Could not read from remote repository.

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

I've cloned the repository since that successfully; it appears that the only thing I can't do is push. Ideas please -- really struggling with this one (mainly because it looks so trivial!)

Just to add a few key details (thanks comment guys!):

I'm an admin of the repository and I didn't create it.

I've checked that the keys already added match the contents of my id_rsa.pub Usually if there's a mismatch in ssh keys I wouldn't be able to pull or clone (unless there's a special case on a private repo I don't know about).

The repo access is ssh; the repository starts with git@bitbucket...

Community
  • 1
  • 1
David Boshton
  • 2,555
  • 5
  • 30
  • 51
  • Is this a repo you created? If not, do you have permission to push to the branch you're trying? You might need to create a `pull request` so that someone else can review and merge your branch into the one you're trying to push to. – Adrian J. Moreno Aug 19 '19 at 16:31
  • Yes there can be repo's restrictions on push. we might need to get the access to push . – thar45 Aug 19 '19 at 16:32
  • Add your SSH public key to the authorized keys on the repo and try again. – J.D.1731 Aug 19 '19 at 21:38
  • Can you try create a new branch and push onto the new branch? If that works, you might want to check if the branch is protected maybe? Might be good to talk to the creator of that repo in case the author decided to restrict push permissions only to him/herself. – Tagger5926 Aug 19 '19 at 22:02
  • Multiple other people can push. And it's a branch I've created myself. – David Boshton Aug 19 '19 at 22:08
  • " the repository starts with git@bitbucket...": is this the output of `git remote -v`? – VonC Aug 20 '19 at 11:12
  • yes it is. ..... – David Boshton Aug 20 '19 at 13:52

1 Answers1

0

First, check the output of git remote -v.

If it starts with https://..., all your SSH check/validation would not matter, since Git would use credentials (username/password) possibly already cached (see if git config credential.helper returns anything)

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250