Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

This repo has moved!

branch: master

This branch is 0 commits ahead and 0 commits behind master

Merge remote-tracking branch 'offbytwo/master'

* offbytwo/master:
  pass --quiet to fast-export to make error cases more obvious, fixed #34
  update to newer fast-export
  sed might be at /usr/bin/sed instead, stop depending on extended regex.

Conflicts:
	Makefile
	bin/git-hg
latest commit ad9b16842b
Cosmin Stejerean cosmin authored
Octocat-spinner-32 bin Merge remote-tracking branch 'offbytwo/master' January 05, 2014
Octocat-spinner-32 fast-export @ aaccfba bump to latest fast-export January 05, 2014
Octocat-spinner-32 .gitignore sed might be at /usr/bin/sed instead, stop depending on extended regex. December 12, 2012
Octocat-spinner-32 .gitmodules changed to http url for fast-export August 04, 2011
Octocat-spinner-32 LICENSE added code, license, readme and script to easily update externals May 14, 2009
Octocat-spinner-32 Makefile sed might be at /usr/bin/sed instead, stop depending on extended regex. December 12, 2012
Octocat-spinner-32 README.markdown README: fix missing mention to 'prefix' flag for `make' September 27, 2013
README.markdown

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

  • Clone an hg repo, including ones over HTTP:

    $ git-hg clone http://some/random/hg/repo [local-git-repo-name]
    
  • Fetch updates from the hg repo:

    $ git-hg fetch
    

    or optionally:

    $ git-hg pull # same as git-hg-fetch && git merge hg/branch_name
    
  • Checkout a new branch from hg:

    $ git-hg checkout branch_name
    
  • Push changes back to hg, optionally to a specific destination:

    $ git-hg push [destination]
    

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

Something went wrong with that request. Please try again.