bitbucket "The requested repository either does not exist or you do not have access."
Asked Answered
C

1

10

I have a bitbucket account. I use it as a remote backup for coding projects.

However, after a creating a repository on bitbucket and trying to push to it, I get this message:

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.

How do I authenticate from the command line?

Crocein answered 23/5, 2021 at 10:36 Comment(1)
There is a number of different mechanisms but creating an SSH keypair is the most common. Does this answer your question? Bitbucket/Github: permission denied public keyBillen
I
2

Hello everyone I get this error when I tried to connect to another account in Bitbucket. If you also have multiple accounts in bitbucket, you will need to set up a configuration file for them.

There is official documentation on this: https://blog.developer.atlassian.com/different-ssh-keys-multiple-bitbucket-accounts/

There is a response from other users: https://mcmap.net/q/259413/-how-to-maintain-multiple-bitbucket-accounts-with-multiple-ssh-keys-in-the-same-system

There are several steps to achieve this (for mac OS):

  1. First of all, create a key for each account ssh-keygen -f ~/.ssh/username1 -C "username1", ssh-keygen -f ~/.ssh/username2 -C "username2"
  2. Edit the ~/.ssh/config file. If you don't have a config file, create one.
  3. Add an alias for each identity combination for example:
#username1
    Host bitbucket.org-user1
    HostName bitbucket.org
    User git
    IdentityFile ~/.ssh/username1
    IdentitiesOnly yes
#username2
    Host bitbucket.org-user2
    HostName bitbucket.org
    User git
    IdentityFile ~/.ssh/username1
    IdentitiesOnly yes
  1. Load each key into the appropriate Bitbucket account
  2. Сheck that ssh-agent is running ps | grep ssh-agent
  3. Check current loaded keys ssh-add -l
  4. If you don't see your keys, add each of them ssh-add ~/.ssh/username1, ssh-add ~/.ssh/username2
  5. Check current loaded keys again ssh-add -l

Now you can work with bitbucket, authentication will be performed automatically

Interurban answered 23/10, 2023 at 7:32 Comment(1)
What are user1 and user2?Jeopardy

© 2022 - 2024 — McMap. All rights reserved.