• RSS
  • Delicious
  • Digg
  • Facebook
  • Twitter
  • Linkedin
  • Youtube

Export Mercurial(Hg) repository to git repository

I have been using a git from quite a some time. But there was a project for which we were using Mercurial(Hg).

We decided to move it’s repository to github, after spending some time on google I found many articles but unfortunately none of them worked for me.

But, Finally I managed to move it from Hg to Git.

Following are the steps I followed:

  1. git clone git://repo.or.cz/fast-export.git
  2. mkdir new_git_repo
  3. cd new_git_repo
  4. git init
  5. /path/to/hg-fast-export.sh -r /path/to/hg_repo #hg-fast-export.sh in the clone of step 1
  6. git-repack -a -d -f
  7. git checkout BRANCH_NAME # BRANCH_NAME is the name of Hg branch, in my case it was ‘trunk’

It worked for me very well, hope same to you guys…

3 Responses so far.

  1. Sumin says:

    It worked for me too. Thanks a lot!

  2. Carlo says:

    The git-repack command seems to have disappeared in Ubuntu 10.10 but “git repack -a -d -f” does the job.

    Thanks!

  3. Perfect! Worked great.
    (git repack on mac too)


Github2S3: Backup Github Repositori...

Cross Posted from http://vinsol.com/blog Who doesn't know GitHub now a days, ...

Edge Rails: Time#current...

Returns Time.zone.now when config.time_zone is set, otherwise just returns Time.now

Edge Rails: Array#random_element...

Array#rand is deprecated in favor of Array#random_element and will be ...

Edge Rails Updates...

New edge rails deprecations: Time#last_year is deprecated in favor of Time#prev_year Time#last_month ...

Download recursive directories with...

Using ftp to download multiple files using 'mget' command is ...

Edge Rails: Time#current...

Returns Time.zone.now when config.time_zone is set, otherwise just returns Time.now

Edge Rails: Array#random_element...

Array#rand is deprecated in favor of Array#random_element and will be ...

Edge Rails Updates...

New edge rails deprecations: Time#last_year is deprecated in favor of Time#prev_year Time#last_month ...

uninitialized constant ActionMailer...

Just a quick note, If you are getting "uninitialized constant ...

11 Things to Consider Before Deploy...

Cross Posted from http://vinsol.com/blog At VinSol, we have been ...