Reputation: 29527
I want to convert a Mercurial project to a Git project. I am following the directions here https://stackoverflow.com/a/34853438/984003 using TortoiseHG.
Enable hggit
Open a command line, enter an empty directory.
git init --bare .git
cd to your Mercurial repository.
hg bookmarks hg
hg push c:/path/to/your/git/repo
In the Git directory: git config --bool core.bare false
After the push command, it said
added 5815 commits with 24723 trees and 24178 blobs
So something happened. But, when I go to repo directory (the path that I pushed to), it's empty except for .git
Upvotes: 1
Views: 999
Reputation: 29527
@zerkmas was right in the comments.
From c:/path/to/your/git/repo, do:
git checkout hg
And then all the files appeared.
EDIT: In the end, this didn't work out for me either. It loses the branches.
I ended up using GitHub's importer:
Convert Bitbucket Mercurial repository to Git. Maintain branches and history. Online solution
Upvotes: 1