From a2a9547373fb7d92d0dfa394ccd8a22fada41571 Mon Sep 17 00:00:00 2001 From: Whitebox Date: Mon, 17 Aug 2015 21:56:11 +0800 Subject: [PATCH 1/4] Sync 01-introduction about-version-control. --- book/01-introduction/sections/about-version-control.asc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/book/01-introduction/sections/about-version-control.asc b/book/01-introduction/sections/about-version-control.asc index 724c2f5a..1152bd0e 100644 --- a/book/01-introduction/sections/about-version-control.asc +++ b/book/01-introduction/sections/about-version-control.asc @@ -53,7 +53,7 @@ image::images/centralized.png[集中化的版本控制图解] 于是分布式版本控制系统(Distributed Version Control System,简称 DVCS)面世了。 在这类系统中,像 Git、Mercurial、Bazaar 以及 Darcs 等,客户端并不只提取最新版本的文件快照,而是把代码仓库完整地镜像下来。 这么一来,任何一处协同工作用的服务器发生故障,事后都可以用任何一个镜像出来的本地仓库恢复。 -因为每一次的提取操作,实际上都是一次对代码仓库的完整备份。 +因为每一次的克隆操作,实际上都是一次对代码仓库的完整备份。 .分布式版本控制. image::images/distributed.png[分布式版本控制图解] From b11cc2287642eee89c705f31778252042053efd0 Mon Sep 17 00:00:00 2001 From: Whitebox Date: Mon, 17 Aug 2015 22:02:00 +0800 Subject: [PATCH 2/4] Sync 01-introduction first-time-setup. --- book/01-introduction/sections/first-time-setup.asc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/book/01-introduction/sections/first-time-setup.asc b/book/01-introduction/sections/first-time-setup.asc index 7749646e..a4c941ce 100644 --- a/book/01-introduction/sections/first-time-setup.asc +++ b/book/01-introduction/sections/first-time-setup.asc @@ -48,7 +48,8 @@ $ git config --global core.editor emacs [WARNING] ==== -Vim 和 Emacs 是像 Linux 与 Mac 等基于 Unix 的系统上开发者经常使用的流行的文本编辑器。如果你对这些编辑器都不是很了解或者你使用的是 Windows 系统,那么可能需要搜索如何在 Git 中配置你最常用的编辑器。 +Vim 和 Emacs 是像 Linux 与 Mac 等基于 Unix 的系统上开发者经常使用的流行的文本编辑器。 +如果你对这些编辑器都不是很了解或者你使用的是 Windows 系统,那么可能需要搜索如何在 Git 中配置你最常用的编辑器。 如果你不设置编辑器并且不知道 Vim 或 Emacs 是什么,当它们运行起来后你可能会被弄糊涂、不知所措。 ==== From 2b3e2b63b1c4860cea6a3744cd6352d68c0f30c6 Mon Sep 17 00:00:00 2001 From: Whitebox Date: Mon, 17 Aug 2015 22:03:39 +0800 Subject: [PATCH 3/4] Sync 01-introduction installing. --- book/01-introduction/sections/installing.asc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/book/01-introduction/sections/installing.asc b/book/01-introduction/sections/installing.asc index 1aa781e3..9da20bcc 100644 --- a/book/01-introduction/sections/installing.asc +++ b/book/01-introduction/sections/installing.asc @@ -6,7 +6,9 @@ [NOTE] ==== -本书写作时使用了 Git 版本 *2.0.0*。我们使用的大部分命令仍然可以在很古老的 Git 版本上使用,但也有少部分命令不好用或者在旧版本中的行为有差异。因为 Git 在保持向后兼容方便表现很好,本书使用的这些命令在 2.0 之后的版本应该有效。 +本书写作时使用了 Git 版本 *2.0.0*。 +我们使用的大部分命令仍然可以在很古老的 Git 版本上使用,但也有少部分命令不好用或者在旧版本中的行为有差异。 +因为 Git 在保持向后兼容方便表现很好,本书使用的这些命令在 2.0 之后的版本应该有效。 ==== ==== 在 Linux 上安装 From 1dd58bbcf39498b313dfefcfa909c59a0e283cdd Mon Sep 17 00:00:00 2001 From: Whitebox Date: Mon, 17 Aug 2015 22:15:00 +0800 Subject: [PATCH 4/4] Sync 01-introduction installing V2. --- book/01-introduction/sections/installing.asc | 28 +++++++++++++------- 1 file changed, 19 insertions(+), 9 deletions(-) diff --git a/book/01-introduction/sections/installing.asc b/book/01-introduction/sections/installing.asc index 9da20bcc..444d17e3 100644 --- a/book/01-introduction/sections/installing.asc +++ b/book/01-introduction/sections/installing.asc @@ -6,7 +6,7 @@ [NOTE] ==== -本书写作时使用了 Git 版本 *2.0.0*。 +本书写作时使用的 Git 版本为 *2.0.0*。 我们使用的大部分命令仍然可以在很古老的 Git 版本上使用,但也有少部分命令不好用或者在旧版本中的行为有差异。 因为 Git 在保持向后兼容方便表现很好,本书使用的这些命令在 2.0 之后的版本应该有效。 ==== @@ -17,11 +17,13 @@ 如果你想在 Linux 上用二进制安装程序来安装 Git,可以使用发行版包含的基础软件包管理工具来安装。 如果以 Fedora 上为例,你可以使用 yum: - $ yum install git +[source,console] + $ sudo yum install git 如果你在基于 Debian 的发行版上,请尝试用 apt-get: - $ apt-get install git +[source,console] + $ sudo apt-get install git 要了解更多选择,Git 官方网站上有在各种 Unix 风格的系统上安装步骤,网址为 http://git-scm.com/download/linux[]。 @@ -63,22 +65,29 @@ image::images/git-osx-installer.png[Git OS X 安装程序。] 二进制安装程序倾向于有一些滞后,当然近几年 Git 已经成熟,这个差异不再显著。 如果你想从源码安装 Git,需要安装 Git 依赖的库:curl、zlib、openssl、expat,还有libiconv。 -如果你的系统上有 yum (如 Fedora)或者 apt-get(如基于 Debian 的系统),可以使用以下命令之一来安装全部依赖: +如果你的系统上有 yum (如 Fedora)或者 apt-get(如基于 Debian 的系统),可以使用以下命令之一来安装最小化的依赖包来编译和安装 Git 的二进制版: - $ yum install curl-devel expat-devel gettext-devel \ +[source,console] + $ sudo yum install curl-devel expat-devel gettext-devel \ openssl-devel zlib-devel - - $ apt-get install libcurl4-gnutls-dev libexpat1-dev gettext \ + $ sudo apt-get install libcurl4-gnutls-dev libexpat1-dev gettext \ libz-dev libssl-dev +为了能够添加更多格式的文档(如 doc, html, info),你需要安装以下的依赖包: + +[source,console] + $ sudo yum install asciidoc xmlto docbook2x + $ sudo apt-get install asciidoc xmlto docbook2x + 当你安装好所有的必要依赖,你可以继续从几个地方来取得最新发布版本的 tar 包。 你可以从 Kernel.org 网站获取,网址为 https://www.kernel.org/pub/software/scm/git[],或从 GitHub 网站上的镜像来获得,网址为 https://github.com/git/git/releases[]。 通常在 GitHub 上的是最新版本,但 kernel.org 上包含有文件下载签名,如果你想验证下载正确性的话会用到。 接着,编译并安装: - $ tar -zxf git-1.9.1.tar.gz - $ cd git-1.9.1 +[source,console] + $ tar -zxf git-2.0.0.tar.gz + $ cd git-2.0.0 $ make configure $ ./configure --prefix=/usr $ make all doc info @@ -86,4 +95,5 @@ image::images/git-osx-installer.png[Git OS X 安装程序。] 完成后,你可以使用 Git 来获取 Git 的升级: +[source,console] $ git clone git://git.kernel.org/pub/scm/git/git.git