HTTPS error while trying to clone with SSH in Bitbucket Cloud
Platform Notice: Cloud - This article applies to Atlassian products on the cloud platform.
Summary
User getting below HTTPS error while trying to clone using SSH.
remote: You may not have access to
this
repository or it no longer exists in
this
workspace. If you think
this
repository exists and you have access, make sure you are authenticated.
fatal: repository
'https://bitbucket.org/WORKSPACEID/REPO.git/'
not found
There are no access issues either.
Cause
By reviewing the error message, it is evident that the SSH URL id replaced with the incorrect HTTPS URL. Due to this incorrect replacement, the issue occurs even though the user was trying to perform the SSH clone.
This issues is observed when user configures an incorrect HTTPS URL in the insteadOf
parameter for SSH in Git's configuration. The insteadOf
parameter is used to rewrite URLs for specific Git remotes. It allows replacement of a part of a URL with another string when Git fetches, pushes, or clones repositories.
Solution
- Check the GIT configuration for the
insteadOf
parameter.
- If any values are incorrectly added, ensure to remove the configuration by opening the GIT config in any of the editors.
- The GIT configurations can checked by running the below command:
git config --list --show-scope