cosmin / git-hg

A git-hg utility for checking out and tracking a mercurial repo.
http://offbytwo.github.com/git-hg
MIT License
307 stars 51 forks source link

git-hg

Description: A set of scripts for checking out and tracking a mercurial project from git. Push supported added as well although it is still experimental.

Author: Cosmin Stejerean (offbytwo)

License: MIT

Dependencies

Mercurial (hg) and python must be installed and in your $PATH.

On Windows, you will also need a copy of Mercurial for Python, available at the Mercurial downloads page

If this is a fresh checkout run

$ git submodule update --init

to pull in fast-export. If for some reason you cannot do this get a copy of fast-export from http://repo.or.cz/w/fast-export.git and place it in the root of the checkout.

Installation

Either add /path/to/this/checkout/bin to your $PATH, or symbolic link /path/to/this/checkout/bin/git-hg into a directory on your $PATH.

Alternatively you can execute

    $ make
    $ sudo make install

to install the script and all required fast-export files in /usr/local (you can change the destination by passing eg PREFIX=/usr to both make invocations)

Usage

Structure

.git/hgcheckout - contains a bare mercurial checkout of the specified repo

.git/hgremote - contains a bare git repo clones from the mercurial one, this is added as a remote called "hg" in the base repo