Mercurial > hg-git
annotate README.md @ 824:27ac3cb46c9d
readme: add docs for git.mindate
author | Siddharth Agarwal <sid0@fb.com> |
---|---|
date | Fri, 31 Oct 2014 11:36:39 -0700 |
parents | 2f8bedc6007d |
children | 82b457515ddb |
rev | line source |
---|---|
43 | 1 Hg-Git Mercurial Plugin |
2 ======================= | |
3 | |
459
a2446c8cf005
README: add URLs of homepage, primary hg repo, and git mirror repo
Brian Warner <warner@lothar.com>
parents:
450
diff
changeset
|
4 * Homepage: http://hg-git.github.com/ |
a2446c8cf005
README: add URLs of homepage, primary hg repo, and git mirror repo
Brian Warner <warner@lothar.com>
parents:
450
diff
changeset
|
5 * https://bitbucket.org/durin42/hg-git (primary) |
a2446c8cf005
README: add URLs of homepage, primary hg repo, and git mirror repo
Brian Warner <warner@lothar.com>
parents:
450
diff
changeset
|
6 * https://github.com/schacon/hg-git (mirror) |
a2446c8cf005
README: add URLs of homepage, primary hg repo, and git mirror repo
Brian Warner <warner@lothar.com>
parents:
450
diff
changeset
|
7 |
341
1f9f4ff47618
README: 80 columns cleanup.
Augie Fackler <durin42@gmail.com>
parents:
340
diff
changeset
|
8 This is the Hg-Git plugin for Mercurial, adding the ability to push |
1f9f4ff47618
README: 80 columns cleanup.
Augie Fackler <durin42@gmail.com>
parents:
340
diff
changeset
|
9 and pull to/from a Git server repository from Hg. This means you can |
1f9f4ff47618
README: 80 columns cleanup.
Augie Fackler <durin42@gmail.com>
parents:
340
diff
changeset
|
10 collaborate on Git based projects from Hg, or use a Git server as a |
1f9f4ff47618
README: 80 columns cleanup.
Augie Fackler <durin42@gmail.com>
parents:
340
diff
changeset
|
11 collaboration point for a team with developers using both Git and Hg. |
43 | 12 |
341
1f9f4ff47618
README: 80 columns cleanup.
Augie Fackler <durin42@gmail.com>
parents:
340
diff
changeset
|
13 The Hg-Git plugin can convert commits/changesets losslessly from one |
1f9f4ff47618
README: 80 columns cleanup.
Augie Fackler <durin42@gmail.com>
parents:
340
diff
changeset
|
14 system to another, so you can push via an Hg repository and another Hg |
1f9f4ff47618
README: 80 columns cleanup.
Augie Fackler <durin42@gmail.com>
parents:
340
diff
changeset
|
15 client can pull it and their changeset node ids will be identical - |
1f9f4ff47618
README: 80 columns cleanup.
Augie Fackler <durin42@gmail.com>
parents:
340
diff
changeset
|
16 Mercurial data does not get lost in translation. It is intended that |
1f9f4ff47618
README: 80 columns cleanup.
Augie Fackler <durin42@gmail.com>
parents:
340
diff
changeset
|
17 Hg users may wish to use this to collaborate even if no Git users are |
1f9f4ff47618
README: 80 columns cleanup.
Augie Fackler <durin42@gmail.com>
parents:
340
diff
changeset
|
18 involved in the project, and it may even provide some advantages if |
1f9f4ff47618
README: 80 columns cleanup.
Augie Fackler <durin42@gmail.com>
parents:
340
diff
changeset
|
19 you're using Bookmarks (see below). |
43 | 20 |
45
a4e53be79ca6
bit of doc cleanup - added dependencies section
Scott Chacon <schacon@gmail.com>
parents:
44
diff
changeset
|
21 Dependencies |
a4e53be79ca6
bit of doc cleanup - added dependencies section
Scott Chacon <schacon@gmail.com>
parents:
44
diff
changeset
|
22 ============ |
a4e53be79ca6
bit of doc cleanup - added dependencies section
Scott Chacon <schacon@gmail.com>
parents:
44
diff
changeset
|
23 |
341
1f9f4ff47618
README: 80 columns cleanup.
Augie Fackler <durin42@gmail.com>
parents:
340
diff
changeset
|
24 This plugin is implemented entirely in Python - there are no Git |
1f9f4ff47618
README: 80 columns cleanup.
Augie Fackler <durin42@gmail.com>
parents:
340
diff
changeset
|
25 binary dependencies, you do not need to have Git installed on your |
724
91b621c6ba9a
readme: drop Mercurial and Dulwich compatibilty information
Siddharth Agarwal <sid0@fb.com>
parents:
674
diff
changeset
|
26 system. The only dependencies are Mercurial and Dulwich. See the |
91b621c6ba9a
readme: drop Mercurial and Dulwich compatibilty information
Siddharth Agarwal <sid0@fb.com>
parents:
674
diff
changeset
|
27 Makefile for information about which versions of Mercurial are |
91b621c6ba9a
readme: drop Mercurial and Dulwich compatibilty information
Siddharth Agarwal <sid0@fb.com>
parents:
674
diff
changeset
|
28 known to work, and setup.py for which versions of Dulwich are required. |
45
a4e53be79ca6
bit of doc cleanup - added dependencies section
Scott Chacon <schacon@gmail.com>
parents:
44
diff
changeset
|
29 |
331
c3ecdfcb91e7
README: rename 'Commands' section to 'Usage'
Tay Ray Chuan <rctay89@gmail.com>
parents:
330
diff
changeset
|
30 Usage |
c3ecdfcb91e7
README: rename 'Commands' section to 'Usage'
Tay Ray Chuan <rctay89@gmail.com>
parents:
330
diff
changeset
|
31 ===== |
43 | 32 |
481
9df1741f3977
help: add additional help topics
David M. Carr <david@carrclan.us>
parents:
459
diff
changeset
|
33 You can clone a Git repository from Hg by running `hg clone <url> [dest]`. For |
328
5875262c92ac
README: reword clone command section
Tay Ray Chuan <rctay89@gmail.com>
parents:
327
diff
changeset
|
34 example, if you were to run |
43 | 35 |
327
f8a94616b957
README: prefix commands with dollar sign
Tay Ray Chuan <rctay89@gmail.com>
parents:
326
diff
changeset
|
36 $ hg clone git://github.com/schacon/hg-git.git |
197
11235deb86fc
README: Added information about the git+ssh:// url format.
Arne Babenhauserheide <bab@draketo.de>
parents:
192
diff
changeset
|
37 |
481
9df1741f3977
help: add additional help topics
David M. Carr <david@carrclan.us>
parents:
459
diff
changeset
|
38 Hg-Git would clone the repository and convert it to an Hg repository |
9df1741f3977
help: add additional help topics
David M. Carr <david@carrclan.us>
parents:
459
diff
changeset
|
39 for you. |
328
5875262c92ac
README: reword clone command section
Tay Ray Chuan <rctay89@gmail.com>
parents:
327
diff
changeset
|
40 |
341
1f9f4ff47618
README: 80 columns cleanup.
Augie Fackler <durin42@gmail.com>
parents:
340
diff
changeset
|
41 If you want to clone a github repository for later pushing (or any |
1f9f4ff47618
README: 80 columns cleanup.
Augie Fackler <durin42@gmail.com>
parents:
340
diff
changeset
|
42 other repository you access via ssh), you need to convert the ssh url |
1f9f4ff47618
README: 80 columns cleanup.
Augie Fackler <durin42@gmail.com>
parents:
340
diff
changeset
|
43 to a format with an explicit protocol prefix. For example, the git url |
1f9f4ff47618
README: 80 columns cleanup.
Augie Fackler <durin42@gmail.com>
parents:
340
diff
changeset
|
44 with push access |
330
37ff4189b05b
README: make url conversion more explicit
Tay Ray Chuan <rctay89@gmail.com>
parents:
329
diff
changeset
|
45 |
37ff4189b05b
README: make url conversion more explicit
Tay Ray Chuan <rctay89@gmail.com>
parents:
329
diff
changeset
|
46 git@github.com:schacon/hg-git.git |
37ff4189b05b
README: make url conversion more explicit
Tay Ray Chuan <rctay89@gmail.com>
parents:
329
diff
changeset
|
47 |
37ff4189b05b
README: make url conversion more explicit
Tay Ray Chuan <rctay89@gmail.com>
parents:
329
diff
changeset
|
48 would read |
200
dfed3bd84184
README: minor fixes
Abderrahim Kitouni <a.kitouni@gmail.com>
parents:
197
diff
changeset
|
49 |
330
37ff4189b05b
README: make url conversion more explicit
Tay Ray Chuan <rctay89@gmail.com>
parents:
329
diff
changeset
|
50 git+ssh://git@github.com/schacon/hg-git.git |
37ff4189b05b
README: make url conversion more explicit
Tay Ray Chuan <rctay89@gmail.com>
parents:
329
diff
changeset
|
51 |
37ff4189b05b
README: make url conversion more explicit
Tay Ray Chuan <rctay89@gmail.com>
parents:
329
diff
changeset
|
52 (Mind the switch from colon to slash after the host!) |
37ff4189b05b
README: make url conversion more explicit
Tay Ray Chuan <rctay89@gmail.com>
parents:
329
diff
changeset
|
53 |
37ff4189b05b
README: make url conversion more explicit
Tay Ray Chuan <rctay89@gmail.com>
parents:
329
diff
changeset
|
54 Your clone command would thus look like this: |
37ff4189b05b
README: make url conversion more explicit
Tay Ray Chuan <rctay89@gmail.com>
parents:
329
diff
changeset
|
55 |
327
f8a94616b957
README: prefix commands with dollar sign
Tay Ray Chuan <rctay89@gmail.com>
parents:
326
diff
changeset
|
56 $ hg clone git+ssh://git@github.com/schacon/hg-git.git |
200
dfed3bd84184
README: minor fixes
Abderrahim Kitouni <a.kitouni@gmail.com>
parents:
197
diff
changeset
|
57 |
481
9df1741f3977
help: add additional help topics
David M. Carr <david@carrclan.us>
parents:
459
diff
changeset
|
58 If you are starting from an existing Hg repository, you have to set up |
9df1741f3977
help: add additional help topics
David M. Carr <david@carrclan.us>
parents:
459
diff
changeset
|
59 a Git repository somewhere that you have push access to, add a path entry |
9df1741f3977
help: add additional help topics
David M. Carr <david@carrclan.us>
parents:
459
diff
changeset
|
60 for it in your .hg/hgrc file, and then run `hg push [name]` from within |
9df1741f3977
help: add additional help topics
David M. Carr <david@carrclan.us>
parents:
459
diff
changeset
|
61 your repository. For example: |
43 | 62 |
327
f8a94616b957
README: prefix commands with dollar sign
Tay Ray Chuan <rctay89@gmail.com>
parents:
326
diff
changeset
|
63 $ cd hg-git # (an Hg repository) |
f8a94616b957
README: prefix commands with dollar sign
Tay Ray Chuan <rctay89@gmail.com>
parents:
326
diff
changeset
|
64 $ # edit .hg/hgrc and add the target git url in the paths section |
f8a94616b957
README: prefix commands with dollar sign
Tay Ray Chuan <rctay89@gmail.com>
parents:
326
diff
changeset
|
65 $ hg push |
197
11235deb86fc
README: Added information about the git+ssh:// url format.
Arne Babenhauserheide <bab@draketo.de>
parents:
192
diff
changeset
|
66 |
481
9df1741f3977
help: add additional help topics
David M. Carr <david@carrclan.us>
parents:
459
diff
changeset
|
67 This will convert all your Hg data into Git objects and push them to the Git server. |
43 | 68 |
341
1f9f4ff47618
README: 80 columns cleanup.
Augie Fackler <durin42@gmail.com>
parents:
340
diff
changeset
|
69 Now that you have an Hg repository that can push/pull to/from a Git |
1f9f4ff47618
README: 80 columns cleanup.
Augie Fackler <durin42@gmail.com>
parents:
340
diff
changeset
|
70 repository, you can fetch updates with `hg pull`. |
43 | 71 |
326
62315903f88b
README: use bare-minimum of 4 spaces for code blocks
Tay Ray Chuan <rctay89@gmail.com>
parents:
319
diff
changeset
|
72 $ hg pull |
197
11235deb86fc
README: Added information about the git+ssh:// url format.
Arne Babenhauserheide <bab@draketo.de>
parents:
192
diff
changeset
|
73 |
341
1f9f4ff47618
README: 80 columns cleanup.
Augie Fackler <durin42@gmail.com>
parents:
340
diff
changeset
|
74 That will pull down any commits that have been pushed to the server in |
1f9f4ff47618
README: 80 columns cleanup.
Augie Fackler <durin42@gmail.com>
parents:
340
diff
changeset
|
75 the meantime and give you a new head that you can merge in. |
43 | 76 |
530
1ec00e2805fb
docs: update to correctly reflect that local git repositories are supported
David M. Carr <david@carrclan.us>
parents:
526
diff
changeset
|
77 Hg-Git can also be used to convert a Mercurial repository to Git. You can use |
1ec00e2805fb
docs: update to correctly reflect that local git repositories are supported
David M. Carr <david@carrclan.us>
parents:
526
diff
changeset
|
78 a local repository or a remote repository accessed via SSH, HTTP or HTTPS. Use |
728
2f8bedc6007d
Fixed small typo
CoolOppo <CoolOppo@users.noreply.github.com>
parents:
724
diff
changeset
|
79 the following commands to convert the repository (it assumes you're running this |
530
1ec00e2805fb
docs: update to correctly reflect that local git repositories are supported
David M. Carr <david@carrclan.us>
parents:
526
diff
changeset
|
80 in $HOME). |
318
f4a125201c5c
README.md: Add information to convert Mercurial to Git.
Simon Ruderich <simon@ruderich.org>
parents:
255
diff
changeset
|
81 |
326
62315903f88b
README: use bare-minimum of 4 spaces for code blocks
Tay Ray Chuan <rctay89@gmail.com>
parents:
319
diff
changeset
|
82 $ mkdir git-repo; cd git-repo; git init; cd .. |
62315903f88b
README: use bare-minimum of 4 spaces for code blocks
Tay Ray Chuan <rctay89@gmail.com>
parents:
319
diff
changeset
|
83 $ cd hg-repo |
62315903f88b
README: use bare-minimum of 4 spaces for code blocks
Tay Ray Chuan <rctay89@gmail.com>
parents:
319
diff
changeset
|
84 $ hg bookmarks hg |
530
1ec00e2805fb
docs: update to correctly reflect that local git repositories are supported
David M. Carr <david@carrclan.us>
parents:
526
diff
changeset
|
85 $ hg push ../git-repo |
318
f4a125201c5c
README.md: Add information to convert Mercurial to Git.
Simon Ruderich <simon@ruderich.org>
parents:
255
diff
changeset
|
86 |
341
1f9f4ff47618
README: 80 columns cleanup.
Augie Fackler <durin42@gmail.com>
parents:
340
diff
changeset
|
87 The hg bookmark is necessary to prevent problems as otherwise hg-git |
1f9f4ff47618
README: 80 columns cleanup.
Augie Fackler <durin42@gmail.com>
parents:
340
diff
changeset
|
88 pushes to the currently checked out branch confusing Git. This will |
1f9f4ff47618
README: 80 columns cleanup.
Augie Fackler <durin42@gmail.com>
parents:
340
diff
changeset
|
89 create a branch named hg in the Git repository. To get the changes in |
1f9f4ff47618
README: 80 columns cleanup.
Augie Fackler <durin42@gmail.com>
parents:
340
diff
changeset
|
90 master use the following command (only necessary in the first run, |
1f9f4ff47618
README: 80 columns cleanup.
Augie Fackler <durin42@gmail.com>
parents:
340
diff
changeset
|
91 later just use git merge or rebase). |
318
f4a125201c5c
README.md: Add information to convert Mercurial to Git.
Simon Ruderich <simon@ruderich.org>
parents:
255
diff
changeset
|
92 |
326
62315903f88b
README: use bare-minimum of 4 spaces for code blocks
Tay Ray Chuan <rctay89@gmail.com>
parents:
319
diff
changeset
|
93 $ cd git-repo |
62315903f88b
README: use bare-minimum of 4 spaces for code blocks
Tay Ray Chuan <rctay89@gmail.com>
parents:
319
diff
changeset
|
94 $ git checkout -b master hg |
318
f4a125201c5c
README.md: Add information to convert Mercurial to Git.
Simon Ruderich <simon@ruderich.org>
parents:
255
diff
changeset
|
95 |
341
1f9f4ff47618
README: 80 columns cleanup.
Augie Fackler <durin42@gmail.com>
parents:
340
diff
changeset
|
96 To import new changesets into the Git repository just rerun the hg |
1f9f4ff47618
README: 80 columns cleanup.
Augie Fackler <durin42@gmail.com>
parents:
340
diff
changeset
|
97 push command and then use git merge or git rebase in your Git |
1f9f4ff47618
README: 80 columns cleanup.
Augie Fackler <durin42@gmail.com>
parents:
340
diff
changeset
|
98 repository. |
318
f4a125201c5c
README.md: Add information to convert Mercurial to Git.
Simon Ruderich <simon@ruderich.org>
parents:
255
diff
changeset
|
99 |
332
9d9a55b0a8af
README: add 'Commands' section and stubs
Tay Ray Chuan <rctay89@gmail.com>
parents:
331
diff
changeset
|
100 Commands |
9d9a55b0a8af
README: add 'Commands' section and stubs
Tay Ray Chuan <rctay89@gmail.com>
parents:
331
diff
changeset
|
101 ======== |
9d9a55b0a8af
README: add 'Commands' section and stubs
Tay Ray Chuan <rctay89@gmail.com>
parents:
331
diff
changeset
|
102 |
9d9a55b0a8af
README: add 'Commands' section and stubs
Tay Ray Chuan <rctay89@gmail.com>
parents:
331
diff
changeset
|
103 gclear |
9d9a55b0a8af
README: add 'Commands' section and stubs
Tay Ray Chuan <rctay89@gmail.com>
parents:
331
diff
changeset
|
104 ------ |
9d9a55b0a8af
README: add 'Commands' section and stubs
Tay Ray Chuan <rctay89@gmail.com>
parents:
331
diff
changeset
|
105 |
9d9a55b0a8af
README: add 'Commands' section and stubs
Tay Ray Chuan <rctay89@gmail.com>
parents:
331
diff
changeset
|
106 TODO |
9d9a55b0a8af
README: add 'Commands' section and stubs
Tay Ray Chuan <rctay89@gmail.com>
parents:
331
diff
changeset
|
107 |
9d9a55b0a8af
README: add 'Commands' section and stubs
Tay Ray Chuan <rctay89@gmail.com>
parents:
331
diff
changeset
|
108 gimport |
9d9a55b0a8af
README: add 'Commands' section and stubs
Tay Ray Chuan <rctay89@gmail.com>
parents:
331
diff
changeset
|
109 ------- |
9d9a55b0a8af
README: add 'Commands' section and stubs
Tay Ray Chuan <rctay89@gmail.com>
parents:
331
diff
changeset
|
110 |
9d9a55b0a8af
README: add 'Commands' section and stubs
Tay Ray Chuan <rctay89@gmail.com>
parents:
331
diff
changeset
|
111 TODO |
9d9a55b0a8af
README: add 'Commands' section and stubs
Tay Ray Chuan <rctay89@gmail.com>
parents:
331
diff
changeset
|
112 |
9d9a55b0a8af
README: add 'Commands' section and stubs
Tay Ray Chuan <rctay89@gmail.com>
parents:
331
diff
changeset
|
113 gexport |
9d9a55b0a8af
README: add 'Commands' section and stubs
Tay Ray Chuan <rctay89@gmail.com>
parents:
331
diff
changeset
|
114 ------- |
9d9a55b0a8af
README: add 'Commands' section and stubs
Tay Ray Chuan <rctay89@gmail.com>
parents:
331
diff
changeset
|
115 |
9d9a55b0a8af
README: add 'Commands' section and stubs
Tay Ray Chuan <rctay89@gmail.com>
parents:
331
diff
changeset
|
116 TODO |
9d9a55b0a8af
README: add 'Commands' section and stubs
Tay Ray Chuan <rctay89@gmail.com>
parents:
331
diff
changeset
|
117 |
9d9a55b0a8af
README: add 'Commands' section and stubs
Tay Ray Chuan <rctay89@gmail.com>
parents:
331
diff
changeset
|
118 git-cleanup |
9d9a55b0a8af
README: add 'Commands' section and stubs
Tay Ray Chuan <rctay89@gmail.com>
parents:
331
diff
changeset
|
119 ----------- |
9d9a55b0a8af
README: add 'Commands' section and stubs
Tay Ray Chuan <rctay89@gmail.com>
parents:
331
diff
changeset
|
120 |
9d9a55b0a8af
README: add 'Commands' section and stubs
Tay Ray Chuan <rctay89@gmail.com>
parents:
331
diff
changeset
|
121 TODO |
318
f4a125201c5c
README.md: Add information to convert Mercurial to Git.
Simon Ruderich <simon@ruderich.org>
parents:
255
diff
changeset
|
122 |
43 | 123 Hg Bookmarks Integration |
124 ======================== | |
125 | |
526
8ede232d3c70
readme: remove references to bookmarks being optional
David M. Carr <david@carrclan.us>
parents:
522
diff
changeset
|
126 Hg-Git pushes your bookmarks up to the Git server as branches and will |
341
1f9f4ff47618
README: 80 columns cleanup.
Augie Fackler <durin42@gmail.com>
parents:
340
diff
changeset
|
127 pull Git branches down and set them up as bookmarks. |
43 | 128 |
129 Installing | |
130 ========== | |
131 | |
341
1f9f4ff47618
README: 80 columns cleanup.
Augie Fackler <durin42@gmail.com>
parents:
340
diff
changeset
|
132 Clone this repository somewhere and make the 'extensions' section in |
1f9f4ff47618
README: 80 columns cleanup.
Augie Fackler <durin42@gmail.com>
parents:
340
diff
changeset
|
133 your `~/.hgrc` file look something like this: |
43 | 134 |
326
62315903f88b
README: use bare-minimum of 4 spaces for code blocks
Tay Ray Chuan <rctay89@gmail.com>
parents:
319
diff
changeset
|
135 [extensions] |
62315903f88b
README: use bare-minimum of 4 spaces for code blocks
Tay Ray Chuan <rctay89@gmail.com>
parents:
319
diff
changeset
|
136 hggit = [path-to]/hg-git/hggit |
43 | 137 |
526
8ede232d3c70
readme: remove references to bookmarks being optional
David M. Carr <david@carrclan.us>
parents:
522
diff
changeset
|
138 That will enable the Hg-Git extension for you. |
44
234bb5784c8b
cleaned up documentation, created initial branch policy
Scott Chacon <schacon@gmail.com>
parents:
43
diff
changeset
|
139 |
481
9df1741f3977
help: add additional help topics
David M. Carr <david@carrclan.us>
parents:
459
diff
changeset
|
140 This plugin is currently tested against the following Mercurial versions: |
674
f0e774680e70
version: drop support for Mercurial 1.9.3
Siddharth Agarwal <sid0@fb.com>
parents:
530
diff
changeset
|
141 |
481
9df1741f3977
help: add additional help topics
David M. Carr <david@carrclan.us>
parents:
459
diff
changeset
|
142 * 2.0.2 |
9df1741f3977
help: add additional help topics
David M. Carr <david@carrclan.us>
parents:
459
diff
changeset
|
143 * 2.1.2 |
9df1741f3977
help: add additional help topics
David M. Carr <david@carrclan.us>
parents:
459
diff
changeset
|
144 * 2.2.3 |
491
2af7e9b67e20
readme: update supported versions in README.md
David M. Carr <david@carrclan.us>
parents:
483
diff
changeset
|
145 * 2.3.1 |
481
9df1741f3977
help: add additional help topics
David M. Carr <david@carrclan.us>
parents:
459
diff
changeset
|
146 |
325
ef7a7df7a8a7
README: document git.intree
Tay Ray Chuan <rctay89@gmail.com>
parents:
319
diff
changeset
|
147 Configuration |
ef7a7df7a8a7
README: document git.intree
Tay Ray Chuan <rctay89@gmail.com>
parents:
319
diff
changeset
|
148 ============= |
ef7a7df7a8a7
README: document git.intree
Tay Ray Chuan <rctay89@gmail.com>
parents:
319
diff
changeset
|
149 |
ef7a7df7a8a7
README: document git.intree
Tay Ray Chuan <rctay89@gmail.com>
parents:
319
diff
changeset
|
150 git.intree |
ef7a7df7a8a7
README: document git.intree
Tay Ray Chuan <rctay89@gmail.com>
parents:
319
diff
changeset
|
151 ---------- |
ef7a7df7a8a7
README: document git.intree
Tay Ray Chuan <rctay89@gmail.com>
parents:
319
diff
changeset
|
152 |
ef7a7df7a8a7
README: document git.intree
Tay Ray Chuan <rctay89@gmail.com>
parents:
319
diff
changeset
|
153 hg-git keeps a git repository clone for reading and updating. By default, the |
ef7a7df7a8a7
README: document git.intree
Tay Ray Chuan <rctay89@gmail.com>
parents:
319
diff
changeset
|
154 git clone is the subdirectory `git` in your local Mercurial repository. If you |
ef7a7df7a8a7
README: document git.intree
Tay Ray Chuan <rctay89@gmail.com>
parents:
319
diff
changeset
|
155 would like this git clone to be at the same level of your Mercurial repository |
ef7a7df7a8a7
README: document git.intree
Tay Ray Chuan <rctay89@gmail.com>
parents:
319
diff
changeset
|
156 instead (named `.git`), add the following to your `hgrc`: |
ef7a7df7a8a7
README: document git.intree
Tay Ray Chuan <rctay89@gmail.com>
parents:
319
diff
changeset
|
157 |
ef7a7df7a8a7
README: document git.intree
Tay Ray Chuan <rctay89@gmail.com>
parents:
319
diff
changeset
|
158 [git] |
ef7a7df7a8a7
README: document git.intree
Tay Ray Chuan <rctay89@gmail.com>
parents:
319
diff
changeset
|
159 intree = True |
449
2e8820592bd3
Add documentation for branch_bookmark_suffix configuration parameter
Mike Bayer <mike_mp@zzzcomputing.com>
parents:
440
diff
changeset
|
160 |
450
163ac98569d3
- add "author file" extension, allows an author translation map
Mike Bayer <mike_mp@zzzcomputing.com>
parents:
449
diff
changeset
|
161 git.authors |
163ac98569d3
- add "author file" extension, allows an author translation map
Mike Bayer <mike_mp@zzzcomputing.com>
parents:
449
diff
changeset
|
162 ----------- |
163ac98569d3
- add "author file" extension, allows an author translation map
Mike Bayer <mike_mp@zzzcomputing.com>
parents:
449
diff
changeset
|
163 |
163ac98569d3
- add "author file" extension, allows an author translation map
Mike Bayer <mike_mp@zzzcomputing.com>
parents:
449
diff
changeset
|
164 Git uses a strict convention for "author names" when representing changesets, |
163ac98569d3
- add "author file" extension, allows an author translation map
Mike Bayer <mike_mp@zzzcomputing.com>
parents:
449
diff
changeset
|
165 using the form `[realname] [email address]`. Mercurial encourages this |
163ac98569d3
- add "author file" extension, allows an author translation map
Mike Bayer <mike_mp@zzzcomputing.com>
parents:
449
diff
changeset
|
166 convention as well but is not as strict, so it's not uncommon for a Mercurial |
163ac98569d3
- add "author file" extension, allows an author translation map
Mike Bayer <mike_mp@zzzcomputing.com>
parents:
449
diff
changeset
|
167 repo to have authors listed as simple usernames. hg-git by default will |
163ac98569d3
- add "author file" extension, allows an author translation map
Mike Bayer <mike_mp@zzzcomputing.com>
parents:
449
diff
changeset
|
168 translate such names using the email address `none@none`, which then shows up |
163ac98569d3
- add "author file" extension, allows an author translation map
Mike Bayer <mike_mp@zzzcomputing.com>
parents:
449
diff
changeset
|
169 unpleasantly on GitHub as "illegal email address". |
163ac98569d3
- add "author file" extension, allows an author translation map
Mike Bayer <mike_mp@zzzcomputing.com>
parents:
449
diff
changeset
|
170 |
163ac98569d3
- add "author file" extension, allows an author translation map
Mike Bayer <mike_mp@zzzcomputing.com>
parents:
449
diff
changeset
|
171 The `git.authors` option provides for an "authors translation file" that will |
163ac98569d3
- add "author file" extension, allows an author translation map
Mike Bayer <mike_mp@zzzcomputing.com>
parents:
449
diff
changeset
|
172 be used during outgoing transfers from mercurial to git only, by modifying |
163ac98569d3
- add "author file" extension, allows an author translation map
Mike Bayer <mike_mp@zzzcomputing.com>
parents:
449
diff
changeset
|
173 `hgrc` as such: |
163ac98569d3
- add "author file" extension, allows an author translation map
Mike Bayer <mike_mp@zzzcomputing.com>
parents:
449
diff
changeset
|
174 |
163ac98569d3
- add "author file" extension, allows an author translation map
Mike Bayer <mike_mp@zzzcomputing.com>
parents:
449
diff
changeset
|
175 [git] |
163ac98569d3
- add "author file" extension, allows an author translation map
Mike Bayer <mike_mp@zzzcomputing.com>
parents:
449
diff
changeset
|
176 authors = authors.txt |
163ac98569d3
- add "author file" extension, allows an author translation map
Mike Bayer <mike_mp@zzzcomputing.com>
parents:
449
diff
changeset
|
177 |
163ac98569d3
- add "author file" extension, allows an author translation map
Mike Bayer <mike_mp@zzzcomputing.com>
parents:
449
diff
changeset
|
178 Where `authors.txt` is the name of a text file containing author name translations, |
163ac98569d3
- add "author file" extension, allows an author translation map
Mike Bayer <mike_mp@zzzcomputing.com>
parents:
449
diff
changeset
|
179 one per each line, using the following format: |
163ac98569d3
- add "author file" extension, allows an author translation map
Mike Bayer <mike_mp@zzzcomputing.com>
parents:
449
diff
changeset
|
180 |
163ac98569d3
- add "author file" extension, allows an author translation map
Mike Bayer <mike_mp@zzzcomputing.com>
parents:
449
diff
changeset
|
181 johnny = John Smith <jsmith@foo.com> |
163ac98569d3
- add "author file" extension, allows an author translation map
Mike Bayer <mike_mp@zzzcomputing.com>
parents:
449
diff
changeset
|
182 dougie = Doug Johnson <dougiej@bar.com> |
163ac98569d3
- add "author file" extension, allows an author translation map
Mike Bayer <mike_mp@zzzcomputing.com>
parents:
449
diff
changeset
|
183 |
163ac98569d3
- add "author file" extension, allows an author translation map
Mike Bayer <mike_mp@zzzcomputing.com>
parents:
449
diff
changeset
|
184 Empty lines and lines starting with a "#" are ignored. |
163ac98569d3
- add "author file" extension, allows an author translation map
Mike Bayer <mike_mp@zzzcomputing.com>
parents:
449
diff
changeset
|
185 |
163ac98569d3
- add "author file" extension, allows an author translation map
Mike Bayer <mike_mp@zzzcomputing.com>
parents:
449
diff
changeset
|
186 It should be noted that **this translation is on the hg->git side only**. Changesets |
163ac98569d3
- add "author file" extension, allows an author translation map
Mike Bayer <mike_mp@zzzcomputing.com>
parents:
449
diff
changeset
|
187 coming from Git back to Mercurial will not translate back into hg usernames, so |
163ac98569d3
- add "author file" extension, allows an author translation map
Mike Bayer <mike_mp@zzzcomputing.com>
parents:
449
diff
changeset
|
188 it's best that the same username/email combination be used on both the hg and git sides; |
163ac98569d3
- add "author file" extension, allows an author translation map
Mike Bayer <mike_mp@zzzcomputing.com>
parents:
449
diff
changeset
|
189 the author file is mostly useful for translating legacy changesets. |
163ac98569d3
- add "author file" extension, allows an author translation map
Mike Bayer <mike_mp@zzzcomputing.com>
parents:
449
diff
changeset
|
190 |
449
2e8820592bd3
Add documentation for branch_bookmark_suffix configuration parameter
Mike Bayer <mike_mp@zzzcomputing.com>
parents:
440
diff
changeset
|
191 git.branch_bookmark_suffix |
2e8820592bd3
Add documentation for branch_bookmark_suffix configuration parameter
Mike Bayer <mike_mp@zzzcomputing.com>
parents:
440
diff
changeset
|
192 --------------------------- |
2e8820592bd3
Add documentation for branch_bookmark_suffix configuration parameter
Mike Bayer <mike_mp@zzzcomputing.com>
parents:
440
diff
changeset
|
193 |
2e8820592bd3
Add documentation for branch_bookmark_suffix configuration parameter
Mike Bayer <mike_mp@zzzcomputing.com>
parents:
440
diff
changeset
|
194 hg-git does not convert between Mercurial named branches and git branches as |
2e8820592bd3
Add documentation for branch_bookmark_suffix configuration parameter
Mike Bayer <mike_mp@zzzcomputing.com>
parents:
440
diff
changeset
|
195 the two are conceptually different; instead, it uses Mercurial bookmarks to |
2e8820592bd3
Add documentation for branch_bookmark_suffix configuration parameter
Mike Bayer <mike_mp@zzzcomputing.com>
parents:
440
diff
changeset
|
196 represent the concept of a git branch. Therefore, when translating an hg repo |
2e8820592bd3
Add documentation for branch_bookmark_suffix configuration parameter
Mike Bayer <mike_mp@zzzcomputing.com>
parents:
440
diff
changeset
|
197 over to git, you typically need to create bookmarks to mirror all the named |
2e8820592bd3
Add documentation for branch_bookmark_suffix configuration parameter
Mike Bayer <mike_mp@zzzcomputing.com>
parents:
440
diff
changeset
|
198 branches that you'd like to see transferred over to git. The major caveat with |
2e8820592bd3
Add documentation for branch_bookmark_suffix configuration parameter
Mike Bayer <mike_mp@zzzcomputing.com>
parents:
440
diff
changeset
|
199 this is that you can't use the same name for your bookmark as that of the |
2e8820592bd3
Add documentation for branch_bookmark_suffix configuration parameter
Mike Bayer <mike_mp@zzzcomputing.com>
parents:
440
diff
changeset
|
200 named branch, and furthermore there's no feasible way to rename a branch in |
2e8820592bd3
Add documentation for branch_bookmark_suffix configuration parameter
Mike Bayer <mike_mp@zzzcomputing.com>
parents:
440
diff
changeset
|
201 Mercurial. For the use case where one would like to transfer an hg repo over |
2e8820592bd3
Add documentation for branch_bookmark_suffix configuration parameter
Mike Bayer <mike_mp@zzzcomputing.com>
parents:
440
diff
changeset
|
202 to git, and maintain the same named branches as are present on the hg side, |
2e8820592bd3
Add documentation for branch_bookmark_suffix configuration parameter
Mike Bayer <mike_mp@zzzcomputing.com>
parents:
440
diff
changeset
|
203 the `branch_bookmark_suffix` might be all that's needed. This presents a |
2e8820592bd3
Add documentation for branch_bookmark_suffix configuration parameter
Mike Bayer <mike_mp@zzzcomputing.com>
parents:
440
diff
changeset
|
204 string "suffix" that will be recognized on each bookmark name, and stripped |
2e8820592bd3
Add documentation for branch_bookmark_suffix configuration parameter
Mike Bayer <mike_mp@zzzcomputing.com>
parents:
440
diff
changeset
|
205 off as the bookmark is translated to a git branch: |
2e8820592bd3
Add documentation for branch_bookmark_suffix configuration parameter
Mike Bayer <mike_mp@zzzcomputing.com>
parents:
440
diff
changeset
|
206 |
2e8820592bd3
Add documentation for branch_bookmark_suffix configuration parameter
Mike Bayer <mike_mp@zzzcomputing.com>
parents:
440
diff
changeset
|
207 [git] |
2e8820592bd3
Add documentation for branch_bookmark_suffix configuration parameter
Mike Bayer <mike_mp@zzzcomputing.com>
parents:
440
diff
changeset
|
208 branch_bookmark_suffix=_bookmark |
2e8820592bd3
Add documentation for branch_bookmark_suffix configuration parameter
Mike Bayer <mike_mp@zzzcomputing.com>
parents:
440
diff
changeset
|
209 |
2e8820592bd3
Add documentation for branch_bookmark_suffix configuration parameter
Mike Bayer <mike_mp@zzzcomputing.com>
parents:
440
diff
changeset
|
210 Above, if an hg repo had a named branch called `release_6_maintenance`, you could |
2e8820592bd3
Add documentation for branch_bookmark_suffix configuration parameter
Mike Bayer <mike_mp@zzzcomputing.com>
parents:
440
diff
changeset
|
211 then link it to a bookmark called `release_6_maintenance_bookmark`. hg-git will then |
2e8820592bd3
Add documentation for branch_bookmark_suffix configuration parameter
Mike Bayer <mike_mp@zzzcomputing.com>
parents:
440
diff
changeset
|
212 strip off the `_bookmark` suffix from this bookmark name, and create a git branch |
2e8820592bd3
Add documentation for branch_bookmark_suffix configuration parameter
Mike Bayer <mike_mp@zzzcomputing.com>
parents:
440
diff
changeset
|
213 called `release_6_maintenance`. When pulling back from git to hg, the `_bookmark` |
2e8820592bd3
Add documentation for branch_bookmark_suffix configuration parameter
Mike Bayer <mike_mp@zzzcomputing.com>
parents:
440
diff
changeset
|
214 suffix is then applied back, if and only if an hg named branch of that name exists. |
2e8820592bd3
Add documentation for branch_bookmark_suffix configuration parameter
Mike Bayer <mike_mp@zzzcomputing.com>
parents:
440
diff
changeset
|
215 E.g., when changes to the `release_6_maintenance` branch are checked into git, these |
2e8820592bd3
Add documentation for branch_bookmark_suffix configuration parameter
Mike Bayer <mike_mp@zzzcomputing.com>
parents:
440
diff
changeset
|
216 will be placed into the `release_6_maintenance_bookmark` bookmark on hg. But if a |
2e8820592bd3
Add documentation for branch_bookmark_suffix configuration parameter
Mike Bayer <mike_mp@zzzcomputing.com>
parents:
440
diff
changeset
|
217 new branch called `release_7_maintenance` were pulled over to hg, and there was |
2e8820592bd3
Add documentation for branch_bookmark_suffix configuration parameter
Mike Bayer <mike_mp@zzzcomputing.com>
parents:
440
diff
changeset
|
218 not a `release_7_maintenance` named branch already, the bookmark will be named |
2e8820592bd3
Add documentation for branch_bookmark_suffix configuration parameter
Mike Bayer <mike_mp@zzzcomputing.com>
parents:
440
diff
changeset
|
219 `release_7_maintenance` with no usage of the suffix. |
2e8820592bd3
Add documentation for branch_bookmark_suffix configuration parameter
Mike Bayer <mike_mp@zzzcomputing.com>
parents:
440
diff
changeset
|
220 |
2e8820592bd3
Add documentation for branch_bookmark_suffix configuration parameter
Mike Bayer <mike_mp@zzzcomputing.com>
parents:
440
diff
changeset
|
221 The `branch_bookmark_suffix` option is, like the `authors` option, intended for |
2e8820592bd3
Add documentation for branch_bookmark_suffix configuration parameter
Mike Bayer <mike_mp@zzzcomputing.com>
parents:
440
diff
changeset
|
222 migrating legacy hg named branches. Going forward, an hg repo that is to |
2e8820592bd3
Add documentation for branch_bookmark_suffix configuration parameter
Mike Bayer <mike_mp@zzzcomputing.com>
parents:
440
diff
changeset
|
223 be linked with a git repo should only use bookmarks for named branching. |
824
27ac3cb46c9d
readme: add docs for git.mindate
Siddharth Agarwal <sid0@fb.com>
parents:
728
diff
changeset
|
224 |
27ac3cb46c9d
readme: add docs for git.mindate
Siddharth Agarwal <sid0@fb.com>
parents:
728
diff
changeset
|
225 git.mindate |
27ac3cb46c9d
readme: add docs for git.mindate
Siddharth Agarwal <sid0@fb.com>
parents:
728
diff
changeset
|
226 ----------- |
27ac3cb46c9d
readme: add docs for git.mindate
Siddharth Agarwal <sid0@fb.com>
parents:
728
diff
changeset
|
227 |
27ac3cb46c9d
readme: add docs for git.mindate
Siddharth Agarwal <sid0@fb.com>
parents:
728
diff
changeset
|
228 If set, branches where the latest commit's commit time is older than this will |
27ac3cb46c9d
readme: add docs for git.mindate
Siddharth Agarwal <sid0@fb.com>
parents:
728
diff
changeset
|
229 not be imported. Accepts any date formats that Mercurial does -- see |
27ac3cb46c9d
readme: add docs for git.mindate
Siddharth Agarwal <sid0@fb.com>
parents:
728
diff
changeset
|
230 `hg help dates` for more. |