

To convert the repository, simply open your command prompt, navigate to your Mercurial repository and do: hg push c:\path\to\bare\git\repositoryĪnd you’re done. Then add a reference to the hggit extension followed by the path of the hggit folder: 1 In the config file, find the section – or add it at bottom if it’s not already there. hgrc or mercurial.ini file in your home directory (for me that’d be c:\users\rasmuskl\mercurial.ini). Now we need to let Mercurial know about the hggit extension. Alternatively you could push directly to a Git repository on either GitHub, Bitbucket or other provider. Open a command prompt, create a directory for the new repository and from within the directory execute: git init –bare Get advisories and other resources for Bitbucket Cloud Access security advisories, end of support announcements for features and functionality, as well as common FAQs.
#Bitbucket push with tortoisehg how to
In this guide we’re going to be pushing our repository to a local Git repository – so let’s create a bare repository – this way you’ll avoid Git complains about pushing to a non-bare repository. Learn everything you need to know about how to build third-party apps with Bitbucket Cloud REST API, as well as how to use OAuth.
#Bitbucket push with tortoisehg zip file
What we need is the hggit folder from the clone or zip file – put this some place handy and remember the path. You can either clone the hggit repository on GitHub or grab a zipped version here. Usually this is done by cloning the repository and then providing the file path to the folder containing the file called init.

PrerequisitesĪs I already mentioned, this guide expects that you have TortoiseHg installed on your system.įor the actual conversion, we’re going to be using a Mercurial extension called hggit that enables Mercurial to push and pull from Git repositories. If you are installing an extension not bundled with TortoiseHg then you need to specify the file path. You can find quite a few posts describing how to convert – but many of the steps mentioned in those guides are not needed if you have TortoiseHg installed, which most Windows Mercurial users do. I still find the best analogy for comparing them is that Git is MacGyver and Mercurial is James Bond. When you clone a repository, the intention is that youll be pushing. I’ve bounced back and forth between Mercurial and Git a few times – my current preference is Git, mainly because I like Git’s branching strategy a bit better – but really, they’re both excellent choices. Interestingly, BitBucket supports both Mercurial and Git now while GitHub still. After going through the pain of (re-)discovering how to convert a Mercurial repository into a Git repository on Windows, I thought I’d share how easy it really is.
