File tree Expand file tree Collapse file tree 1 file changed +5
-5
lines changed
book/09-git-and-other-scms/sections Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change 1
1
==== Mercurial
2
2
3
3
(((Mercurial)))(((Importing, from Mercurial)))
4
- 因为 Mercurial 与 Git 在表示版本时有着非常相似的模型,但是因为 Git 更灵活一点,将一个仓库从 Mercurial 转换到 Git 是相当直接的,使用一个叫作“hg-fast-export”的工具,你需要从这里拷贝一份 :
4
+ 因为 Mercurial 与 Git 在表示版本时有着非常相似的模型,但是因为 Git 更灵活一点,将一个仓库从 Mercurial 转换到 Git 是相当直接的,使用一个叫作“hg-fast-export”的工具,需要从这里拷贝一份 :
5
5
6
6
[source,console]
7
7
----
8
8
$ git clone http://repo.or.cz/r/fast-export.git /tmp/fast-export
9
9
----
10
10
11
- 转换的第一步就是要先得到你想要转换的 Mercurial 仓库的完整克隆:
11
+ 转换的第一步就是要先得到想要转换的 Mercurial 仓库的完整克隆:
12
12
13
13
[source,console]
14
14
----
15
15
$ hg clone <remote repo URL> /tmp/hg-repo
16
16
----
17
17
18
18
下一步就是创建一个作者映射文件。
19
- Mercurial 在它放入到变更集作者字段的内容比 Git 更宽容一些,所以这是一个打扫屋子的好机会。
19
+ Mercurial 对放入到变更集作者字段的内容比 Git 更宽容一些,所以这是一个打扫屋子的好机会。
20
20
生成映射是 `bash` 终端下的一行命令:
21
21
22
22
[source,console]
@@ -25,7 +25,7 @@ $ cd /tmp/hg-repo
25
25
$ hg log | grep user: | sort | uniq | sed 's/user: *//' > ../authors
26
26
----
27
27
28
- 这会花费几秒钟,具体要看你的项目提交历史有多少 ,最终 `/tmp/authors` 文件看起来会像这样:
28
+ 这会花费几秒钟,具体要看项目提交历史有多少 ,最终 `/tmp/authors` 文件看起来会像这样:
29
29
30
30
[source]
31
31
----
@@ -111,7 +111,7 @@ $ git shortlog -sn
111
111
112
112
那看起来非常好。
113
113
所有 Mercurial 标签都已被转换成 Git 标签,Mercurial 分支与书签都被转换成 Git 分支。
114
- 现在你已经准备好推送仓库到新的服务器那边 :
114
+ 现在已经准备好推送仓库到新的服务器那边 :
115
115
116
116
[source,console]
117
117
----
You can’t perform that action at this time.
0 commit comments