create a new empty git repository (e.g. bitbucket)
sudo easy_install hg-git
vi ~/.hgrc [extensions] hggit=
hg showconfig cd ~/myproject-hg-repo/ hg bookmark -r default master
hg push git+ssh://git@bitbucket.org:USERNAME/REPONAME.git
If you need to prune some large files out first, use filemap by enabling hg convert:
vi ~/.hgrc [extensions] hgext.convert= hggit=
mkdir /home/USER/NEWNAME cd /home/USER/NEWNAME hg init
vi /home/USER/mymap.txt
by default / of the repo is included
if include it becomes an explicit include (all others are automatically excluded)
exclude "path/in/repo/to/dir" exclude "path/in/repo/tofile"
hg convert --filemap /home/USER/mymap.txt /home/USER/HGREPONAME /home/USER/NEWNAME
http://mercurial.selenic.com/wiki/ConvertExtension#A--filemap http://hgbook.red-bean.com/read/migrating-to-mercurial.html#svn.filemap