I converted a few mercurial repos to git using the hg-fast-export tool and while all of them were converted fine, one produced the following error when I pushed the repo.
You can use the convert
command with a filemap to strip the git repo from the repository. After that it will be gone from the history, and the repository will be safe for importing to git.
Example:
$ echo "exclude path/to/.git" > my-filemap
$ hg convert --filemap my-filemap originalrepo newrepo
Note that convert
is a bundled extension which you first need to enable in your .hgrc
like so:
[extensions]
convert =
For more information see hg help convert
.