Differences between revisions 5 and 6
Revision 5 as of 2020-06-29 14:53:14
Size: 1556
Editor: AugieFackler
Comment:
Revision 6 as of 2020-09-24 17:29:14
Size: 1595
Editor: timeless
Comment: octopus merges are a todo
Deletions are marked like this. Additions are marked like this.
Line 3: Line 3:
Line 9: Line 8:
Line 15: Line 13:
Line 21: Line 18:
Line 23: Line 19:
Install pygit2 into the Python used by your Mercurial:
{{{$(hg debuginstall -T'{pythonexe}') -m pip install --user pygit2}}}
Install pygit2 into the Python used by your Mercurial: {{{$(hg debuginstall -T'{pythonexe}') -m pip install --user pygit2}}}
Line 28: Line 23:
Line 32: Line 28:
Line 34: Line 29:
Line 39: Line 33:
 * Repositories with octopus merges are not supported.
Line 55: Line 50:
Line 57: Line 51:
Line 59: Line 52:
Line 63: Line 55:
Line 67: Line 60:

git

Operate on Git repositories.

1. Status

This extension is distributed with Mercurial as experimental.

Author: Augie Fackler

2. Overview

This extension grants Mercurial the ability to operate on Git repositories.

Requires pygit2.

3. Usage

3.1. Installation

Install pygit2 into the Python used by your Mercurial: $(hg debuginstall -T'{pythonexe}') -m pip install --user pygit2

3.2. Configuration

Enable the extension:

[extensions]
git =

3.3. Use

In the Mercurial 5.4 release:

  • git(1) must be used for all network operations (e.g. clone, push, pull, incoming, outgoing).

  • Only local branches are presented in Hg (as bookmarks). Use git branch -t remotes/origin/branchname to see more upstream branches as bookmarks.

  • Repositories with octopus merges are not supported.

Example:

git clone git://...
hg init --git
hg status
hg log
hg bookmarks
hg diff
hg add
hg commit
git push
git pull
...

4. Alternatives

4.1. HgGit

The HgGit extension, which is installed separately from Mercurial, is more mature and more widely used.

It converts a git repository into a native Mercurial repository (including incremental imports). As a consequence:

  • each commit has a Mercurial hash and a separate Git hash (accessible using the "gitnode" revset/template keyword).
  • the converted repository is roughly twice as large.

4.2. Convert

The ConvertExtension, packaged with Mercurial, has Git support.

GitExtension (last edited 2020-09-24 17:33:01 by timeless)