forked from hg-git/hg-git.github.com
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
211 lines (186 loc) · 7.8 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<title>Hg-Git Mercurial Plugin</title>
<script type="text/javascript" src="js/jquery-1.2.6.pack.js"></script>
<script type="text/javascript" src="js/thickbox-compressed.js"></script>
<script type="text/javascript" src="http://github.com/javascripts/jquery.corner.js"></script>
<link rel="stylesheet" href="css/screen.css" type="text/css" media="screen, projection">
<link rel="stylesheet" href="css/print.css" type="text/css" media="print">
<!--[if IE]>
<link rel="stylesheet" href="css/ie.css" type="text/css" media="screen, projection">
<![endif]-->
<link rel="stylesheet" href="css/style.css" type="text/css" media="screen" charset="utf-8"/>
<link rel="stylesheet" href="css/thickbox.css" type="text/css" media="screen"/>
</head>
<body>
<div class="container">
<h1 class="tbar"><small>the</small> Hg-Git <small>mercurial plugin</small></h1>
<p>
This is the Hg-Git plugin for Mercurial, adding the ability
to <strong>push to and pull from a Git server</strong>
repository from Mercurial. This means you can collaborate on Git
based projects from Mercurial, or use a Git server as a
collaboration point for a team with developers using both Git
and Mercurial.
</p>
<div class='section'>
<div class="title">The Big Idea</div>
<img style="float:right; padding:10px;" height="120" src="images/server.png">
<p>
The Hg-Git plugin can <strong>convert commits/changesets
losslessly</strong> from one system to another, so you can
push via a Mercurial repository and another Mercurial
client can pull it. In theory, the changeset IDs should
not change, although this may not hold true for complex
histories.
</p>
</div>
<div class='section'>
<div class="title">Commands</div>
<p>
You can clone a Git repository from Mercurial by
running <code>hg clone [url]</code>. It will create a
directory with the same name as the last path component. For
example, if you were to run <code>hg clone
git://github.com/schacon/munger.git</code> it would clone
the repository down into the directory 'munger.git', then
convert it to a Mercurial repository for you.
</p>
<pre>hg clone git://github.com/schacon/munger.git</pre>
<p>
If you are starting from an existing Mercurial repository,
you have to setup a Git repository somewhere that you have
push access to, and then run <code>hg push [path]</code>
from within your project. For example:
</p>
<pre>$ cd hg-git # (a Mercurial repository)
$ hg bookmark -r default master # make a bookmark of master for default, so a ref gets created
$ hg push git+ssh://[email protected]/schacon/hg-git.git
$ hg push</pre>
<p>
This will convert all our Mercurial data into Git objects
and push them up to the Git server. You can also put that
path in the <code>[paths]</code> section of .hg/hgrc and
then push to it by name.
</p>
<p>
Now that you have a Mercurial repository that can push/pull
to/from a Git repository, you can get updates
with <code>hg pull</code>.
</p>
<pre>$ hg pull</pre>
<p>
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.
</p>
</div>
<div class='section'>
<div class="title">Installing</div>
<h3>Installing Hg-Git the easy way:</h3>
<p>
First, make sure that you have a working C compiler on your
system. On Windows, one option is the
free <a href="http://msdn.microsoft.com/en-us/express/future/bb421473">Microsoft
Visual C++</a>. (Be sure to install the 2008 version for
compatibility reasons.) On Debian-style Linux,
run <code>apt-get install python-dev</code>.
</p>
<p>
Secondly, run <code>easy_install hg-git</code>. If you don't
have easy_install available, you can get it as part of
Python's
<a href="http://pypi.python.org/pypi/setuptools">setuptools</a>
package.
</p>
<p>
Lastly, make sure the
following is in your <code>~/.hgrc</code>:
</p>
<pre>[extensions]
hgext.bookmarks =
hggit = </pre>
<p>
...and that's it!
</p>
<h3>Installing Hg-Git manually</h3>
<p>
Use this method if you'd like to install a clone of the Hg-Git
repository rather than a static package, or if you'd like to
install Hg-Git in a location you choose yourself.
</p>
<p>
First, install version 0.8.0 or newer of
<a href="http://pypi.python.org/pypi/dulwich">Dulwich</a>.
You can do
<code>easy_install 'dulwich>=0.8.0'</code> if you have
<a href="http://pypi.python.org/pypi/setuptools">setuptools</a>
installed. Next, clone
<a href="http://bitbucket.org/durin42/hg-git">the Hg-Git
repository</a>
somewhere. Lastly, make the 'extensions' section in your
'<code>~/.hgrc</code>' file look something like this:
</p>
<pre>[extensions]
hgext.bookmarks =
hggit = [path-to]/hg-git/hggit</pre>
<p>
That will enable the Hg-Git extension for you. The bookmarks
section is only required prior to hg 1.7. Bookmarks will be
translated to git heads when pushing.
</p>
</div>
<div class='section'>
<div class="title">Dependencies</div>
<p>
This plugin is known to work on Mercurial 1.7, and is
basically functional (with a couple of bugs) against hg 1.8
and 1.9. It also needs Dulwich version 0.8.0 or later; Dulwich
is a pure-Python implementation of the Git file formats and
protocols. There are <strong>no Git binary
dependencies</strong>: you do not need to have Git installed
on your system.
</p>
</div>
<div class='section'>
<div class="title">Sources</div>
<p>
Source available via
<a href="http://bitbucket.org/durin42/hg-git">hg</a>
(canonical repo) or
<a href="http://github.com/schacon/hg-git">git</a> (mirror
of hg). Patches preferred via email to
the <a href="http://groups.google.com/group/hg-git">hg-git
mailing list</a>.
</p>
</div>
<div class="span-21">
<div id="bottom">
This plugin was originally developed by the folks
at <a href="http://github.com">GitHub</a>, and is currently
maintained by Augie Fackler.
</div>
</div>
<div id="footer" class="span-21">
<div class="info span-12">
<div class="links">
<a href="http://groups.google.com/group/hg-git/">Google Group</a>
</div>
</div>
<div class="fork span-7">
This website is <a href="http://github.com/hg-git/hg-git.github.com">open source</a>.
Please help us by forking the project and adding to it.
</div>
</div>
</div>
<script type="text/javascript">
$(function() {
$('.title').corner();
$('.tbar').corner();
});
</script>
</body>
</html>