Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

How to clone this repository

Using Git

$ git clone git://github.com/b4winckler/vim.git

Using Mercurial

Make sure you have enabled the hg-git and bookmarks extensions before this step (see below).

$ hg clone git://github.com/b4winckler/vim.git

How this repository was cloned from the Vim Mercurial repository

The hg-git Mercurial extension (as well as Mercurial itself) is required in order to track a Mercurial repository with Git, see below on how to enable it.

Create local Mercurial clone:

$ hg clone -U https://vim.googlecode.com/hg/ vim
$ cd vim

(The -U flag tells Mercurial not to check out a working copy, i.e. the clone will be a bare repository.)

Add bookmark to master branch:

Make sure the bookmarks extension is enabled before this step (see below).

$ hg bookmark -r default master

(Optional) Add bookmark to other Mercurial branches:

$ hg bookmark -r vim73 hg/vim73
$ hg bookmark -r vim72 hg/vim72

Set up Mercurial so that it pushes to the Git repository:

Edit vim/.hg/hgrc and add default-push path:

[paths]
default-push = git+ssh://git@github.com:b4winckler/vim.git

Push all changesets to the Git repository:

Be aware that this may take a long time to complete (up to several hours!).

$ hg push

Updating the Git repository:

Every time the Mercurial repository is modified it is necessary to manually update the Git repository.

First pull all new changesets from the Mercurial repository (since we have no working copy checked out, there is no need to merge).

$ hg pull

Bookmarks created with the -r flag are not automatically updated when you pull the latest changesets, so manually update the bookmarks (the -f flag is required to force the update):

$ hg bookmark -fr default master

If you bookmarked other branches, then update them as well:

$ hg bookmark -fr vim73 hg/vim73
$ hg bookmark -fr vim72 hg/vim72

Now push all new changesets to the Git repository (this time it will only take a minute or so):

$ hg push

Setting up Mercurial:

Install hg-git (see below for instructions on how to install hg-git manually):

$ sudo easy_install hg-git

To enable the hg-git and bookmarks extensions, edit ~/.hgrc and add:

[extensions]
bookmarks =
hggit =

Manual install of hg-git:

If you would rather not use easy_install (whatever the reason) then it is not too hard to install hg-git manually. To do so you first clone the hg-git and dulwich repositories. Then go to the dulwich repository and type

$ python setup.py --pure install --user

You can try without the --pure flag. If that works dulwich will run faster.

Finally, modify ~/.hgrc so that it says:

[extensions]
bookmarks =
hggit = path-to-hg-git

where you replace path-to-hg-git with the full path to the hg-git repository (e.g. ~/Source/hg-git).

Notes

Note that the hg-git bridge is lossless, so that:

  • If you loose your local Mercurial repository, the above steps can be repeated to set up a new one and you can continue updating the Git repository (only new changesets will be pushed).
  • If somebody else sets up a Git clone of the Mercurial repository you can git-pull from that to update your own Git clone (the Git commit ids are identical).
  • A maintainer of the Mercurial repository can pull changesets into a Mercurial repository from a cloned Git repository.
  • You can use Mercurial to clone a Git clone (if you prefer using Mercurial over Git). New changesets can be pulled from either the original Mercurial repository or from any Git clone. (Normally you would just clone the Mercurial repository, of course.)
Something went wrong with that request. Please try again.