Why do I suddenly need SSH?

ic2 June 22, 2022

After a couple of uninterrupted and working Pulls (the most recent interruption that costed us a few hours was the introduction  of app passwords, which I had to create twice again so far when it stopped working, thank you very much for this 'safety feature') , the latest surprise was the message:

The authenticity of host 'bitbucket.org can't be established. (etc)

After again a long time of trial and error entering obscure commands in obscure 1980 style command prompts, I got a working SSH key which was apparently the solution and vould again pull the changes of the solution of my colleague. Let's see how many times/days it works this time before the next error or issue....

Does anyone know why I got this? I changed nothing and my colleague didn't either.  What changed and why?

It would be really great if we could synchronize code without having to spend time every time solving unsolicited changes like this.

1 answer

0 votes
Theodora Boudale
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
June 28, 2022

Hi @ic2,

The protocol used is determined by the remote repo URL in your clone.

If you run git remote -v in your clone and the output looks like the below, then SSH will be used.

origin git@bitbucket.org:workspace/repo.git (fetch)
origin git@bitbucket.org:workspace/repo.git (push)

If the output of git remote -v shows a URL like the below, then HTTPS will be used:

origin https://BitbucketUsername@bitbucket.org/workspace/repo.git (fetch)
origin https://BitbucketUsername@bitbucket.org/workspace/repo.git (push)

This info is saved in the .git/config file of a user's clone.

The only possible reasons I can think of for this issue are
a) someone switched the remote URL of that clone from an HTTPS one to SSH
b) the directory of a previous clone was deleted, and someone made a new clone of the repo using an SSH URL

If you want to change the remote URL in a clone, you can use the following command:

git remote set-url origin <repo_url>

where
origin replace with the name of your remote, if different
<repo_url> you can use either the HTTPS URL of the repo or the SSH one, depending on what you prefer to use.

Kind regards,
Theodora

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PERMISSIONS LEVEL
Site Admin
TAGS
AUG Leaders

Atlassian Community Events