SourceTree: How do I connect a local clone with a remote repo on Stash with SSH

I work with Atlassian Stash to host Git repositories. SourceTree is very handy to look at my local clones and manage them.

I now discovered the "Hosted repositories" feature of SourceTree, which fetches and lists all repos within a Stash project and allows to create local clones. Hurray! However, I already have local clones of most repos. SourceTree offers to open an existing clone. If I do that I get the following error:

Remote details do not match
There is no remote defined in the repository you selected that matches the incoming remote project details. If you definitely want to associate this repository with this remote link that pleas edit the remote details on your repository to match.

But what are these "remote details" that should "match"? I tried renaming the remote, to `origin` or `stash` instead of the `central` I usually like to use. None of that works. But since SourceTree does not provide any details on what it is comparing, I have no chance of updating my setup.

I finally realized that I use ssh to access Stash, so my local clones have an ssh remote configured. How can I make SourceTree do the following alltogether:

  • load the list of hosted repos on Stash
  • use ssh to push/pull etc.
  • connect the local clone and the remote repo in SourceTree

1 answer

SourceTree can usually infer the link from your hosted projects accounts if the hosts match up, but you can specify it manually via Settings (top right toolbar). Edit the remote and you can fill in the bottom section to provide the Stash root URL & username, if it wasn't automatically derived.

The URLs I would expect to show up look exactly like the ones that are depicted in your screenshot, however, no automatic inferation happenend for me. What must I do to convince SourceTree to infer the https URL from the ssh:7999 URL which is set in the configured remote? I don't want to update the settings for each of the projects manually.

Suggest an answer

Log in or Sign up to answer
How to earn badges on the Atlassian Community

How to earn badges on the Atlassian Community

Badges are a great way to show off community activity, whether you’re a newbie or a Champion.

Learn more
Community showcase
Posted Jun 12, 2018 in Bitbucket

Do you use any Atlassian products for your personal projects?

After spinning my wheels trying to get organized enough to write a book for National Novel Writing Month (NaNoWriMo) I took my affinity for Atlassian products from my work life and decided to tr...

22,243 views 26 11
Join discussion

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you