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

Getting git to work with bitbucket in VSCode for MacOS is hell

kleinnic74 January 4, 2023



I have been following to connect VSCode with Atlassian bitbucket, but still I cannot push to my git repository. I could clone the repo I am interested in, but cannot push back to it. It keeps telling me "Unauthorised, Please make sure you have the correct access rights and repository exists."

Obviously, I need to do something else or in addition to what is described in this article. 

The documentation could very well be improved and detailing how to configure git to push back to bitbucket. Also, cloning the repository from the Atlassian extension does nothing at all to setup things up correctly so I can push back.

Very, very frustrating.



1 answer

0 votes
Theodora Boudale
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
January 6, 2023

Hi Nicolas,

When you clone a repository, the remote url is set on your local clone.

Based on the error you see, I assume you are using SSH, is that correct?

If that's the case, the SSH client on your machine may not be sending the SSH key you have set up for Bitbucket Cloud when you push.

If you have only one Bitbucket Cloud account and you use only one SSH key with Bitbucket Cloud from that machine, you can edit the ~/.ssh/config file on your machine (if it doesn't exist, you need to create it first) and add the following configuration:

PreferredAuthentications publickey
IdentityFile /Users/myUser/.ssh/id_rsa

where /Users/myUser/.ssh/id_rsa replace with the path and name of your private SSH key, whose public key is uploaded to your Bitbucket account. This will ensure that this key is always offered when you interact via SSH with this repo.

Kind regards,

Suggest an answer

Log in or Sign up to answer
AUG Leaders

Atlassian Community Events