How can I push from Git to Mercurial with SourceTree?

I've installed hg-git and am trying to push from a local Git repo to a local Mercurial repo so I can push to Bitbucket Mercurial repo. How can I do this? This answer from 2008 (https://answers.atlassian.com/questions/19756/how-to-use-hg-git-with-sourcetree) says you don't need hg-git if you're using SourceTree but I'm unable to get this working. I even tried pushing straight from local Git repo to Bitbucket Mercurial repo but it would not work.

2 answers

3 votes
Colin Goudie Community Champion Jan 11, 2012

I think you'd be best off using commandline hg using the hg-git plugin directly

http://hg-git.github.com/

A few things though

1. Is this an existing mercurial repository? And if so, whats in the git repository?

2. Or are you trying to just convert a local git repo so it's mercurial now?

Also, bitbucket can just host a git repository now as well if that is easier for you.

The answer you linked is actually from November 8 2011 rather than November 08 ;)

SourceTree isn't really designed for this since it supports both git and hg natively. However as mentioned in the previous answer, a hg-git setup may work with 1.3 because of the cross-link support of hg main repositories with git subrepositories. 1.3 is currently only in beta, so unless you deliberately retrieved the beta you'll still be on 1.2 which definitely doesn't support it.

On the whole, if you're using SourceTree you might as well use the native system (whether that's hg or git) rather than bridging since SourceTree gives you a unified interface anyway. Bitbucket also supports either hg or git repositories now, so you're not locked in to either system.

Suggest an answer

Log in or Join to answer
Community showcase
Brian Ganninger
Published Jan 23, 2018 in Sourcetree

Tip from the team: workflow and keyboard shortcuts

Supported Platforms macOS Sourcetree has a lot to offer and, like many developer tools, finding and using it all can be a challenge, especially for a new user. Everyone might not love ...

270 views 0 3
Read article

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
Atlassian Team Tour

Join us on the Team Tour

We're bringing product updates and pro tips on teamwork to ten cities around the world.

Save your spot