annotate README.md @ 45:a4e53be79ca6

bit of doc cleanup - added dependencies section
author Scott Chacon <schacon@gmail.com>
date Tue, 28 Apr 2009 18:59:41 -0700
parents 234bb5784c8b
children 0bfcd0c06b8e
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
43
e965895856e9 initial readme file
Scott Chacon <schacon@gmail.com>
parents:
diff changeset
1 Hg-Git Mercurial Plugin
e965895856e9 initial readme file
Scott Chacon <schacon@gmail.com>
parents:
diff changeset
2 =======================
e965895856e9 initial readme file
Scott Chacon <schacon@gmail.com>
parents:
diff changeset
3
e965895856e9 initial readme file
Scott Chacon <schacon@gmail.com>
parents:
diff changeset
4 This is the Hg-Git plugin for Mercurial, adding the ability to push and pull to/from a Git server repository from Hg. This means you can collaborate on Git based projects from Hg, or use a Git server as a collaboration point for a team with developers using both Git and Hg.
e965895856e9 initial readme file
Scott Chacon <schacon@gmail.com>
parents:
diff changeset
5
44
234bb5784c8b cleaned up documentation, created initial branch policy
Scott Chacon <schacon@gmail.com>
parents: 43
diff changeset
6 The Hg-Git plugin can convert commits/changesets losslessly from one system to another, so you can push via an Hg repository and another Hg client can pull it and thier changeset node ids will be identical - Mercurial data does not get lost in translation (* not currently fully implemented, but it will!). It is intended that Hg users may wish to use this to collaborate even if no Git users are involved in the project, as it may provide some advantages if you're using Bookmarks (see below).
43
e965895856e9 initial readme file
Scott Chacon <schacon@gmail.com>
parents:
diff changeset
7
45
a4e53be79ca6 bit of doc cleanup - added dependencies section
Scott Chacon <schacon@gmail.com>
parents: 44
diff changeset
8 Dependencies
a4e53be79ca6 bit of doc cleanup - added dependencies section
Scott Chacon <schacon@gmail.com>
parents: 44
diff changeset
9 ============
a4e53be79ca6 bit of doc cleanup - added dependencies section
Scott Chacon <schacon@gmail.com>
parents: 44
diff changeset
10
a4e53be79ca6 bit of doc cleanup - added dependencies section
Scott Chacon <schacon@gmail.com>
parents: 44
diff changeset
11 This plugin is implemented entirely in Python - there are no Git binary dependencies, you do not need to have Git installed on your system. There are in fact no external dependencies currently other than Mercurial. The plugin is known to work on Hg versions 1.1 and 1.2.
a4e53be79ca6 bit of doc cleanup - added dependencies section
Scott Chacon <schacon@gmail.com>
parents: 44
diff changeset
12
43
e965895856e9 initial readme file
Scott Chacon <schacon@gmail.com>
parents:
diff changeset
13 Commands
e965895856e9 initial readme file
Scott Chacon <schacon@gmail.com>
parents:
diff changeset
14 =========
e965895856e9 initial readme file
Scott Chacon <schacon@gmail.com>
parents:
diff changeset
15
e965895856e9 initial readme file
Scott Chacon <schacon@gmail.com>
parents:
diff changeset
16 You can clone a Git repository from Hg by running `hg gclone [url]`. It will create a directory appended with a '-hg', for example, if you were to run `hg gclone git://github.com/schacon/munger.git` it would clone the repository down into the directory 'munger-hg', then convert it to an Hg repository for you.
e965895856e9 initial readme file
Scott Chacon <schacon@gmail.com>
parents:
diff changeset
17
e965895856e9 initial readme file
Scott Chacon <schacon@gmail.com>
parents:
diff changeset
18 hg gclone git://github.com/schacon/munger.git
e965895856e9 initial readme file
Scott Chacon <schacon@gmail.com>
parents:
diff changeset
19
e965895856e9 initial readme file
Scott Chacon <schacon@gmail.com>
parents:
diff changeset
20 If you are starting from an existing Hg repository, you have to setup a Git repository somewhere that you have push access to, add it as a Git remote and then run `hg gpush` from within your project. For example:
e965895856e9 initial readme file
Scott Chacon <schacon@gmail.com>
parents:
diff changeset
21
e965895856e9 initial readme file
Scott Chacon <schacon@gmail.com>
parents:
diff changeset
22 $ cd hg-git # (an Hg repository)
e965895856e9 initial readme file
Scott Chacon <schacon@gmail.com>
parents:
diff changeset
23 $ hg gremote add origin git@github.com/schacon/hg-git.git
e965895856e9 initial readme file
Scott Chacon <schacon@gmail.com>
parents:
diff changeset
24 $ hg push
e965895856e9 initial readme file
Scott Chacon <schacon@gmail.com>
parents:
diff changeset
25
e965895856e9 initial readme file
Scott Chacon <schacon@gmail.com>
parents:
diff changeset
26 This will convert all our Hg data into Git objects and push them up to the Git server.
e965895856e9 initial readme file
Scott Chacon <schacon@gmail.com>
parents:
diff changeset
27
e965895856e9 initial readme file
Scott Chacon <schacon@gmail.com>
parents:
diff changeset
28 Now that you have an Hg repository that can push/pull to/from a Git repository, you can fetch updates with `hg gfetch`.
e965895856e9 initial readme file
Scott Chacon <schacon@gmail.com>
parents:
diff changeset
29
e965895856e9 initial readme file
Scott Chacon <schacon@gmail.com>
parents:
diff changeset
30 $ hg gfetch
e965895856e9 initial readme file
Scott Chacon <schacon@gmail.com>
parents:
diff changeset
31
e965895856e9 initial readme file
Scott Chacon <schacon@gmail.com>
parents:
diff changeset
32 That will pull down any commits that have been pushed to the server in the meantime and give you a new head that you can merge in.
e965895856e9 initial readme file
Scott Chacon <schacon@gmail.com>
parents:
diff changeset
33
e965895856e9 initial readme file
Scott Chacon <schacon@gmail.com>
parents:
diff changeset
34 Hg Bookmarks Integration
e965895856e9 initial readme file
Scott Chacon <schacon@gmail.com>
parents:
diff changeset
35 ========================
e965895856e9 initial readme file
Scott Chacon <schacon@gmail.com>
parents:
diff changeset
36
e965895856e9 initial readme file
Scott Chacon <schacon@gmail.com>
parents:
diff changeset
37 Hg-Git works will use your bookmarks if you have any or have the bookmarks extension enabled. It will allow you to push your bookmarks up to the Git server as branches and will pull Git branches down and set them up as bookmarks if you want.
e965895856e9 initial readme file
Scott Chacon <schacon@gmail.com>
parents:
diff changeset
38
e965895856e9 initial readme file
Scott Chacon <schacon@gmail.com>
parents:
diff changeset
39 This is actually pretty cool, since you can use this extension to transfer your Hg bookmarks via the Git protocol, rather than having to scp them, as the Hg transfer protocol does not currently support transferring bookmarks.
e965895856e9 initial readme file
Scott Chacon <schacon@gmail.com>
parents:
diff changeset
40
e965895856e9 initial readme file
Scott Chacon <schacon@gmail.com>
parents:
diff changeset
41 Installing
e965895856e9 initial readme file
Scott Chacon <schacon@gmail.com>
parents:
diff changeset
42 ==========
e965895856e9 initial readme file
Scott Chacon <schacon@gmail.com>
parents:
diff changeset
43
e965895856e9 initial readme file
Scott Chacon <schacon@gmail.com>
parents:
diff changeset
44 Clone this repository somewhere and make the 'extensions' section in your `~/.hgrc` file look something like this:
e965895856e9 initial readme file
Scott Chacon <schacon@gmail.com>
parents:
diff changeset
45
e965895856e9 initial readme file
Scott Chacon <schacon@gmail.com>
parents:
diff changeset
46 [extensions]
e965895856e9 initial readme file
Scott Chacon <schacon@gmail.com>
parents:
diff changeset
47 hgext.bookmarks =
e965895856e9 initial readme file
Scott Chacon <schacon@gmail.com>
parents:
diff changeset
48 hgext.hg-git = [path-to]/hg-git
e965895856e9 initial readme file
Scott Chacon <schacon@gmail.com>
parents:
diff changeset
49
e965895856e9 initial readme file
Scott Chacon <schacon@gmail.com>
parents:
diff changeset
50 That will enable the Hg-Git extension for you. The bookmarks section is not compulsory, but it makes some things a bit nicer for you.
44
234bb5784c8b cleaned up documentation, created initial branch policy
Scott Chacon <schacon@gmail.com>
parents: 43
diff changeset
51
234bb5784c8b cleaned up documentation, created initial branch policy
Scott Chacon <schacon@gmail.com>
parents: 43
diff changeset
52 Authors
234bb5784c8b cleaned up documentation, created initial branch policy
Scott Chacon <schacon@gmail.com>
parents: 43
diff changeset
53 ========
234bb5784c8b cleaned up documentation, created initial branch policy
Scott Chacon <schacon@gmail.com>
parents: 43
diff changeset
54
234bb5784c8b cleaned up documentation, created initial branch policy
Scott Chacon <schacon@gmail.com>
parents: 43
diff changeset
55 * Scott Chacon <schacon@gmail.com> - main development
234bb5784c8b cleaned up documentation, created initial branch policy
Scott Chacon <schacon@gmail.com>
parents: 43
diff changeset
56 * Augie Fackler <durin42@gmail.com> - testing and moral support.
45
a4e53be79ca6 bit of doc cleanup - added dependencies section
Scott Chacon <schacon@gmail.com>
parents: 44
diff changeset
57 * Dulwich Developers - most of this code depends on the awesome work they did.
44
234bb5784c8b cleaned up documentation, created initial branch policy
Scott Chacon <schacon@gmail.com>
parents: 43
diff changeset
58
234bb5784c8b cleaned up documentation, created initial branch policy
Scott Chacon <schacon@gmail.com>
parents: 43
diff changeset
59 Sponsorship
234bb5784c8b cleaned up documentation, created initial branch policy
Scott Chacon <schacon@gmail.com>
parents: 43
diff changeset
60 ===========
234bb5784c8b cleaned up documentation, created initial branch policy
Scott Chacon <schacon@gmail.com>
parents: 43
diff changeset
61
45
a4e53be79ca6 bit of doc cleanup - added dependencies section
Scott Chacon <schacon@gmail.com>
parents: 44
diff changeset
62 GitHub let me (Scott) work on this full time for several days, which is why this got done at all. If you're looking for a free Git host to push your open source Hg projects to, do try us out (http://github.com).