From 03bfddcd29bada949ca7cebcc239f6b1e3550c29 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=AF=BA=E5=A2=A8?= Date: Wed, 16 Feb 2022 23:31:46 +0800 Subject: [PATCH 01/67] docs(go-git): translate go-git documentation --- book/B-embedding-git/sections/go-git.asc | 52 ++++++++++++------------ 1 file changed, 26 insertions(+), 26 deletions(-) diff --git a/book/B-embedding-git/sections/go-git.asc b/book/B-embedding-git/sections/go-git.asc index b83ca4b9..2299b70b 100644 --- a/book/B-embedding-git/sections/go-git.asc +++ b/book/B-embedding-git/sections/go-git.asc @@ -1,13 +1,12 @@ === go-git (((go-git)))(((Go))) -In case you want to integrate Git into a service written in Golang, there also is a pure Go library implementation. -This implementation does not have any native dependencies and thus is not prone to manual memory management errors. -It is also transparent for the standard Golang performance analysis tooling like CPU, Memory profilers, race detector, etc. +如果你想将 Git 集成到用 Golang 编写的服务中,这里还有一个纯 Go 库的实现。这个库的实现没有任何原生依赖,因此不易出现手动管理内存的错误。 +它对于标准 Golang 性能分析工具(如 CPU、内存分析器、竞争检测器等)也是透明的。 -go-git is focused on extensibility, compatibility and supports most of the plumbing APIs, which is documented at https://github.com/src-d/go-git/blob/master/COMPATIBILITY.md[]. +go-git 专注于可扩展性、兼容性并支持大多数管道 API,记录在 https://github.com/src-d/go-git/blob/master/COMPATIBILITY.md[]. -Here is a basic example of using Go APIs: +以下是使用 Go API 的基本示例: [source, go] ----- @@ -19,31 +18,31 @@ r, err := git.PlainClone("/tmp/foo", false, &git.CloneOptions{ }) ----- -As soon as you have a `Repository` instance, you can access information and perform mutations on it: +你只要拥有一个 `Repository` 实例,就可以访问相应仓库信息并对其进行改变: [source, go] ----- -// retrieves the branch pointed by HEAD +// 获取 HEAD 指向的分支 ref, err := r.Head() -// get the commit object, pointed by ref +// 获取由 ref 指向的提交对象 commit, err := r.CommitObject(ref.Hash()) -// retrieves the commit history +// 检索提交历史 history, err := commit.History() -// iterates over the commits and print each +// 遍历并逐个打印提交 for _, c := range history { fmt.Println(c) } ----- -==== Advanced Functionality +==== 高级功能 -go-git has few notable advanced features, one of which is a pluggable storage system, which is similar to Libgit2 backends. -The default implementation is in-memory storage, which is very fast. +go-git 几乎没有值得注意的高级功能,其中之一是可插拔存储系统,类似于 Libgit2 后端。 +默认实现是内存存储,速度非常快。 [source, go] ----- @@ -52,35 +51,36 @@ r, err := git.Clone(memory.NewStorage(), nil, &git.CloneOptions{ }) ----- -Pluggable storage provides many interesting options. -For instance, https://github.com/src-d/go-git/tree/master/_examples/storage[] allows you to store references, objects, and configuration in an Aerospike database. +可插拔存储提供了许多有趣的选项。 +例如,https://github.com/src-d/go-git/tree/master/_examples/storage[] 允许你在 Aerospike 数据库中存储引用、对象和配置。 -Another feature is a flexible filesystem abstraction. -Using https://godoc.org/github.com/src-d/go-billy#Filesystem[] it is easy to store all the files in different way i.e by packing all of them to a single archive on disk or by keeping them all in-memory. +另一个特性是灵活的文件系统抽象。 +使用 https://godoc.org/github.com/src-d/go-billy#Filesystem[] +可以很容易以不同的方式存储所有文件,即通过将所有文件打包到磁盘上的单个归档文件或保存它们都在内存中。 -Another advanced use-case includes a fine-tunable HTTP client, such as the one found at https://github.com/src-d/go-git/blob/master/_examples/custom_http/main.go[]. +另一个高级用例包括一个可微调的 HTTP 客户端,例如 https://github.com/src-d/go-git/blob/master/_examples/custom_http/main.go[] 中的案例。 [source, go] ----- customClient := &http.Client{ - Transport: &http.Transport{ // accept any certificate (might be useful for testing) + Transport: &http.Transport{ // 接受任何证书(可能对测试有用) TLSClientConfig: &tls.Config{InsecureSkipVerify: true}, }, - Timeout: 15 * time.Second, // 15 second timeout + Timeout: 15 * time.Second, // 15 秒超时 CheckRedirect: func(req *http.Request, via []*http.Request) error { - return http.ErrUseLastResponse // don't follow redirect + return http.ErrUseLastResponse // 不要跟随重定向 }, } -// Override http(s) default protocol to use our custom client +// 覆盖 http(s) 默认协议以使用我们的自定义客户端 client.InstallProtocol("https", githttp.NewClient(customClient)) -// Clone repository using the new client if the protocol is https:// +// 如果协议为 https://,则使用新客户端克隆存储库 r, err := git.Clone(memory.NewStorage(), nil, &git.CloneOptions{URL: url}) ----- -==== Further Reading +==== 延伸阅读 -A full treatment of go-git's capabilities is outside the scope of this book. -If you want more information on go-git, there's API documentation at https://godoc.org/gopkg.in/src-d/go-git.v4[], and a set of usage examples at https://github.com/src-d/go-git/tree/master/_examples[]. +对 go-git 功能的全面介绍超出了本书的范围。 +如果您想了解有关 go-git 的更多信息,请参阅 https://godoc.org/gopkg.in/src-d/go-git.v4[] 上的 API 文档, 以及 https://github.com/src-d/go-git/tree/master/_examples[] 上的系列使用示例。 \ No newline at end of file From b32a857c7e006f728c6badee8bf1f88ce208d294 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=AF=BA=E5=A2=A8?= Date: Fri, 18 Feb 2022 23:41:05 +0800 Subject: [PATCH 02/67] docs(go-git): update go-git's github repository url --- book/B-embedding-git/sections/go-git.asc | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/book/B-embedding-git/sections/go-git.asc b/book/B-embedding-git/sections/go-git.asc index 2299b70b..cf5eab0c 100644 --- a/book/B-embedding-git/sections/go-git.asc +++ b/book/B-embedding-git/sections/go-git.asc @@ -4,7 +4,7 @@ 如果你想将 Git 集成到用 Golang 编写的服务中,这里还有一个纯 Go 库的实现。这个库的实现没有任何原生依赖,因此不易出现手动管理内存的错误。 它对于标准 Golang 性能分析工具(如 CPU、内存分析器、竞争检测器等)也是透明的。 -go-git 专注于可扩展性、兼容性并支持大多数管道 API,记录在 https://github.com/src-d/go-git/blob/master/COMPATIBILITY.md[]. +go-git 专注于可扩展性、兼容性并支持大多数管道 API,记录在 https://github.com/go-git/go-git/blob/master/COMPATIBILITY.md[]. 以下是使用 Go API 的基本示例: @@ -52,13 +52,13 @@ r, err := git.Clone(memory.NewStorage(), nil, &git.CloneOptions{ ----- 可插拔存储提供了许多有趣的选项。 -例如,https://github.com/src-d/go-git/tree/master/_examples/storage[] 允许你在 Aerospike 数据库中存储引用、对象和配置。 +例如,https://github.com/go-git/go-git/tree/master/_examples/storage[] 允许你在 Aerospike 数据库中存储引用、对象和配置。 另一个特性是灵活的文件系统抽象。 使用 https://godoc.org/github.com/src-d/go-billy#Filesystem[] 可以很容易以不同的方式存储所有文件,即通过将所有文件打包到磁盘上的单个归档文件或保存它们都在内存中。 -另一个高级用例包括一个可微调的 HTTP 客户端,例如 https://github.com/src-d/go-git/blob/master/_examples/custom_http/main.go[] 中的案例。 +另一个高级用例包括一个可微调的 HTTP 客户端,例如 https://github.com/go-git/go-git/blob/master/_examples/custom_http/main.go[] 中的案例。 [source, go] ----- @@ -83,4 +83,4 @@ r, err := git.Clone(memory.NewStorage(), nil, &git.CloneOptions{URL: url}) ==== 延伸阅读 对 go-git 功能的全面介绍超出了本书的范围。 -如果您想了解有关 go-git 的更多信息,请参阅 https://godoc.org/gopkg.in/src-d/go-git.v4[] 上的 API 文档, 以及 https://github.com/src-d/go-git/tree/master/_examples[] 上的系列使用示例。 \ No newline at end of file +如果您想了解有关 go-git 的更多信息,请参阅 https://godoc.org/gopkg.in/src-d/go-git.v4[] 上的 API 文档, 以及 https://github.com/go-git/go-git/tree/master/_examples[] 上的系列使用示例。 \ No newline at end of file From 04a8e044d2fcaf5653ae617d48c49bc8a73798fe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=AF=BA=E5=A2=A8?= Date: Sat, 19 Feb 2022 23:27:19 +0800 Subject: [PATCH 03/67] docs(go-git): correct misaligned newlines --- book/B-embedding-git/sections/go-git.asc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/book/B-embedding-git/sections/go-git.asc b/book/B-embedding-git/sections/go-git.asc index cf5eab0c..69fa82df 100644 --- a/book/B-embedding-git/sections/go-git.asc +++ b/book/B-embedding-git/sections/go-git.asc @@ -1,7 +1,8 @@ === go-git (((go-git)))(((Go))) -如果你想将 Git 集成到用 Golang 编写的服务中,这里还有一个纯 Go 库的实现。这个库的实现没有任何原生依赖,因此不易出现手动管理内存的错误。 +如果你想将 Git 集成到用 Golang 编写的服务中,这里还有一个纯 Go 库的实现。 +这个库的实现没有任何原生依赖,因此不易出现手动管理内存的错误。 它对于标准 Golang 性能分析工具(如 CPU、内存分析器、竞争检测器等)也是透明的。 go-git 专注于可扩展性、兼容性并支持大多数管道 API,记录在 https://github.com/go-git/go-git/blob/master/COMPATIBILITY.md[]. @@ -55,8 +56,7 @@ r, err := git.Clone(memory.NewStorage(), nil, &git.CloneOptions{ 例如,https://github.com/go-git/go-git/tree/master/_examples/storage[] 允许你在 Aerospike 数据库中存储引用、对象和配置。 另一个特性是灵活的文件系统抽象。 -使用 https://godoc.org/github.com/src-d/go-billy#Filesystem[] -可以很容易以不同的方式存储所有文件,即通过将所有文件打包到磁盘上的单个归档文件或保存它们都在内存中。 +使用 https://godoc.org/github.com/src-d/go-billy#Filesystem[] 可以很容易以不同的方式存储所有文件,即通过将所有文件打包到磁盘上的单个归档文件或保存它们都在内存中。 另一个高级用例包括一个可微调的 HTTP 客户端,例如 https://github.com/go-git/go-git/blob/master/_examples/custom_http/main.go[] 中的案例。 From 315278104a239c9bd4a38fbb5a87c65904e8db6d Mon Sep 17 00:00:00 2001 From: cangyin <1522645226@qq.com> Date: Tue, 22 Feb 2022 15:15:13 +0800 Subject: [PATCH 04/67] fix 1, close #446 --- book/04-git-server/sections/gitlab.asc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/book/04-git-server/sections/gitlab.asc b/book/04-git-server/sections/gitlab.asc index dff7eba5..2a253264 100644 --- a/book/04-git-server/sections/gitlab.asc +++ b/book/04-git-server/sections/gitlab.asc @@ -92,7 +92,7 @@ GitLab 在项目和系统级别上都支持钩子程序。 你想要在 GitLab 做的第一件事就是建立一个新项目。 这通过点击工具栏上的 “+” 图标完成。 -你会被要求填写项目名称,也就是这个项目所属的命名空间,以及它的可视层级。 +你需要填写项目名称,项目所属命名空间,以及它的可视层级。 绝大多数的设定并不是永久的,可以通过设置界面重新调整。 点击 “Create Project”,你就完成了。 From f82205d1400c6bdd056562c28d537e274a5b8e86 Mon Sep 17 00:00:00 2001 From: cangyin <1522645226@qq.com> Date: Tue, 22 Feb 2022 15:24:00 +0800 Subject: [PATCH 05/67] fix 2, close #448 --- book/05-distributed-git/sections/contributing.asc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/book/05-distributed-git/sections/contributing.asc b/book/05-distributed-git/sections/contributing.asc index 6c0f76a8..ed611036 100644 --- a/book/05-distributed-git/sections/contributing.asc +++ b/book/05-distributed-git/sections/contributing.asc @@ -50,7 +50,7 @@ image::images/git-diff-check.png[`git diff --check` 的输出。] 如果可以,尝试让改动可以理解——不要在整个周末编码解决五个问题,然后在周一时将它们提交为一个巨大的提交。 即使在周末期间你无法提交,在周一时使用暂存区域将你的工作最少拆分为每个问题一个提交,并且为每一个提交附带一个有用的信息。 如果其中一些改动修改了同一个文件,尝试使用 `git add --patch` 来部分暂存文件(在 <> 中有详细介绍)。 -不管你做一个或五个提交,只要所有的改动是在同一时刻添加的,项目分支末端的快照就是独立的,使同事开发者必须审查你的改动时尽量让事情容易些。 +不管你做一个或五个提交,只要所有的改动都曾添加过,项目分支末端的快照就是一样的,所以尽量让你的开发者同事们在审查你的改动的时候更容易些吧。 当你之后需要时这个方法也会使拉出或还原一个变更集更容易些。 <> 描述了重写历史与交互式暂存文件的若干有用的 Git 技巧——在将工作发送给其他人前使用这些工具来帮助生成一个干净又易懂的历史。 From 058836f407afa8e2202207d3dbb7ad665fd1154a Mon Sep 17 00:00:00 2001 From: cangyin <1522645226@qq.com> Date: Tue, 22 Feb 2022 15:25:50 +0800 Subject: [PATCH 06/67] fix 3 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Octocat -> octopus-cat -> 章鱼猫 --- book/06-github/sections/1-setting-up-account.asc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/book/06-github/sections/1-setting-up-account.asc b/book/06-github/sections/1-setting-up-account.asc index 96bf5280..a11a0d48 100644 --- a/book/06-github/sections/1-setting-up-account.asc +++ b/book/06-github/sections/1-setting-up-account.asc @@ -19,7 +19,7 @@ GitHub 的付费计划包含一些高级工具和功能,不过本书将不涉 关于可选方案及其对比的更多信息见 https://github.com/pricing[]。 ==== -点击屏幕左上角的 Octocat 图标,你将来到控制面板页面。 +点击屏幕左上角的章鱼猫(Octocat)图标,你将来到控制面板页面。 现在,你已经做好了使用 GitHub 的准备工作。 ==== SSH 访问 From 2e5a65205f98d9cea0e0815bb600582989b39aa8 Mon Sep 17 00:00:00 2001 From: cangyin <1522645226@qq.com> Date: Tue, 22 Feb 2022 15:46:58 +0800 Subject: [PATCH 07/67] modify issue template for Chinese translation, close #447 --- .github/ISSUE_TEMPLATE/bug_report.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md index c1b1a0a7..15a4350a 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.md +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -10,10 +10,10 @@ assignees: '' - - - - + + + + From c2eb946bc3e8a87672d4d55f3379a3328aa7ba84 Mon Sep 17 00:00:00 2001 From: cangyin <1522645226@qq.com> Date: Fri, 25 Feb 2022 11:42:11 +0800 Subject: [PATCH 08/67] fix bad translation MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 纠正否定语义 --- book/06-github/sections/2-contributing.asc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/book/06-github/sections/2-contributing.asc b/book/06-github/sections/2-contributing.asc index b862c316..6c8c9e99 100644 --- a/book/06-github/sections/2-contributing.asc +++ b/book/06-github/sections/2-contributing.asc @@ -540,6 +540,6 @@ $ git push <3> <2> 从 `progit` 抓取更改后合并到 `master` <3> 将 `master` 分支推送到 `origin` -这种方法非常有用,而且没有缺点。Git 非常乐意为你暗中做这些工作,而且它不会在你向 `master` -提交更改,从 `progit` 拉取更改,然后向 `origin` 推送时通知你,所有这些操作在这种配置下都是有效的。 -因此你不必对直接提交到 `master` 有所顾虑,因为该分支从效果上来说属于上游仓库。 +这种方法可能很有用,但也不是没有缺点。如果你向 `master` 提交,再从 `progit` 中拉取,然后推送到 +`origin`,Git 会很乐意安静地为您完成这项工作,但不会警告你——所有这些操作在以上设置下都是有效的。 +所以你必须注意永远不要直接提交到 `master`,因为该分支实际上属于上游仓库。 From 8fc5349fd49b9ee042e9eb7921d8a7ad48d5e204 Mon Sep 17 00:00:00 2001 From: Yunbin Liu Date: Mon, 7 Mar 2022 16:15:35 +0800 Subject: [PATCH 09/67] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E7=94=B1=E4=BA=8E?= =?UTF-8?q?=E7=BC=BA=E5=B0=91=E7=A9=BA=E6=A0=BC=E5=AF=BC=E8=87=B4=20=20git?= =?UTF-8?q?=5Fdeflate=5Fbound=20=20=E7=9A=84=E6=98=BE=E7=A4=BA=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- book/07-git-tools/sections/searching.asc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/book/07-git-tools/sections/searching.asc b/book/07-git-tools/sections/searching.asc index 780ae0c9..d917424c 100644 --- a/book/07-git-tools/sections/searching.asc +++ b/book/07-git-tools/sections/searching.asc @@ -119,7 +119,7 @@ ef49a7a zlib: zlib can only process 4GB at a time 行日志搜索是另一个相当高级并且有用的日志搜索功能。 在 `git log` 后加上 `-L` 选项即可调用,它可以展示代码中一行或者一个函数的历史。 -例如,假设我们想查看 `zlib.c` 文件中`git_deflate_bound` 函数的每一次变更, +例如,假设我们想查看 `zlib.c` 文件中 `git_deflate_bound` 函数的每一次变更, 我们可以执行 `git log -L :git_deflate_bound:zlib.c`。 Git 会尝试找出这个函数的范围,然后查找历史记录,并且显示从函数创建之后一系列变更对应的补丁。 From 848e02ac535b8abb755cdb8cb220297390a49af9 Mon Sep 17 00:00:00 2001 From: jckling Date: Thu, 17 Mar 2022 14:15:24 +0800 Subject: [PATCH 10/67] =?UTF-8?q?distributed=20=E5=BA=94=E7=BF=BB=E8=AF=91?= =?UTF-8?q?=E4=B8=BA=E5=88=86=E5=B8=83=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ch04-git-on-the-server.asc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ch04-git-on-the-server.asc b/ch04-git-on-the-server.asc index 98535901..48249978 100644 --- a/ch04-git-on-the-server.asc +++ b/ch04-git-on-the-server.asc @@ -14,7 +14,7 @@ 下面一节将解释使用那些协议的典型设置及如何在你的服务器上运行。 最后,如果你不介意托管你的代码在其他人的服务器,且不想经历设置与维护自己服务器的麻烦,可以试试我们介绍的几个仓库托管服务。 -如果你对架设自己的服务器没兴趣,可以跳到本章最后一节去看看如何申请一个代码托管服务的帐户然后继续下一章,我们会在那里讨论分散式源码控制环境的林林总总。 +如果你对架设自己的服务器没兴趣,可以跳到本章最后一节去看看如何申请一个代码托管服务的帐户然后继续下一章,我们会在那里讨论分布式源码控制环境的林林总总。 一个远程仓库通常只是一个裸仓库(bare repository)——即一个没有当前工作目录的仓库。 因为该仓库仅仅作为合作媒介,不需要从磁盘检查快照;存放的只有 Git 的资料。 From a25cfc6d51e4c3239e8d69196701fbf746cc9ab7 Mon Sep 17 00:00:00 2001 From: jckling Date: Thu, 17 Mar 2022 14:17:32 +0800 Subject: [PATCH 11/67] =?UTF-8?q?=E8=A1=A5=E5=85=85=E7=BC=BA=E6=BC=8F?= =?UTF-8?q?=E7=9A=84=E6=96=87=E5=AD=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- book/02-git-basics/sections/recording-changes.asc | 4 ++-- book/07-git-tools/sections/submodules.asc | 2 +- book/07-git-tools/sections/subtree-merges.asc | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/book/02-git-basics/sections/recording-changes.asc b/book/02-git-basics/sections/recording-changes.asc index fb3c27a8..62024ba2 100644 --- a/book/02-git-basics/sections/recording-changes.asc +++ b/book/02-git-basics/sections/recording-changes.asc @@ -34,7 +34,7 @@ nothing to commit, working directory clean 这说明你现在的工作目录相当干净。换句话说,所有已跟踪文件在上次提交后都未被更改过。 此外,上面的信息还表明,当前目录下没有出现任何处于未跟踪状态的新文件,否则 Git 会在这里列出来。 最后,该命令还显示了当前所在分支,并告诉你这个分支同远程服务器上对应的分支没有偏离。 -现在,分支名是“master”,这是默认的分支名。 +现在,分支名是“master”,这是默认的分支名。 我们在 <> 中会详细讨论分支和引用。 现在,让我们在项目下创建一个新的 `README` 文件。 @@ -197,7 +197,7 @@ M lib/simplegit.rb 新添加的未跟踪文件前面有 `??` 标记,新添加到暂存区中的文件前面有 `A` 标记,修改过的文件前面有 `M` 标记。 输出中有两栏,左栏指明了暂存区的状态,右栏指明了工作区的状态。例如,上面的状态报告显示: `README` 文件在工作区已修改但尚未暂存,而 `lib/simplegit.rb` 文件已修改且已暂存。 -`Rakefile` 文件已修,暂存后又作了修改,因此该文件的修改中既有已暂存的部分,又有未暂存的部分。 +`Rakefile` 文件已修改,暂存后又作了修改,因此该文件的修改中既有已暂存的部分,又有未暂存的部分。 [[_ignoring]] ==== 忽略文件 diff --git a/book/07-git-tools/sections/submodules.asc b/book/07-git-tools/sections/submodules.asc index b14838e9..4b14ca23 100644 --- a/book/07-git-tools/sections/submodules.asc +++ b/book/07-git-tools/sections/submodules.asc @@ -643,7 +643,7 @@ To https://github.com/chaconinc/MainProject ===== 合并子模块改动 -如果你其他人同时改动了一个子模块引用,那么可能会遇到一些问题。 +如果你和其他人同时改动了一个子模块引用,那么可能会遇到一些问题。 也就是说,如果子模块的历史已经分叉并且在父项目中分别提交到了分叉的分支上,那么你需要做一些工作来修复它。 如果一个提交是另一个的直接祖先(一个快进式合并),那么 Git 会简单地选择之后的提交来合并,这样没什么问题。 diff --git a/book/07-git-tools/sections/subtree-merges.asc b/book/07-git-tools/sections/subtree-merges.asc index ed2ee002..b3154b95 100644 --- a/book/07-git-tools/sections/subtree-merges.asc +++ b/book/07-git-tools/sections/subtree-merges.asc @@ -99,7 +99,7 @@ Rack 项目中所有的改动都被合并了,等待被提交到本地。 $ git diff-tree -p rack_branch ---- -或者,将你的 `rack` 子目和最近一次从服务器上抓取的 `master` 分支进行比较,你可以运行: +或者,将你的 `rack` 子目录和最近一次从服务器上抓取的 `master` 分支进行比较,你可以运行: [source,console] ---- From 80f0badee43f130da9a884f71c9da2561798a71b Mon Sep 17 00:00:00 2001 From: jckling Date: Thu, 17 Mar 2022 14:18:08 +0800 Subject: [PATCH 12/67] =?UTF-8?q?=E5=88=A0=E9=99=A4=E5=A4=9A=E4=BD=99?= =?UTF-8?q?=E7=A9=BA=E6=A0=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- book/04-git-server/sections/smart-http.asc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/book/04-git-server/sections/smart-http.asc b/book/04-git-server/sections/smart-http.asc index 581c0d05..efe02f84 100644 --- a/book/04-git-server/sections/smart-http.asc +++ b/book/04-git-server/sections/smart-http.asc @@ -18,10 +18,10 @@ $ sudo apt-get install apache2 apache2-utils $ a2enmod cgi alias env ---- -该操作将会启用 `mod_cgi`, `mod_alias`, 和 `mod_env` 等 Apache 模块, 这些模块都是使该功能正常工作所必须的。 +该操作将会启用 `mod_cgi`, `mod_alias` 和 `mod_env` 等 Apache 模块, 这些模块都是使该功能正常工作所必须的。 你还需要将 `/srv/git` 的 Unix 用户组设置为 `www-data`,这样 Web 服务器才能读写该仓库, -因为 运行 CGI 脚本的 Apache 实例默认会以该用户的权限运行: +因为运行 CGI 脚本的 Apache 实例默认会以该用户的权限运行: [source,console] ---- From e6ed0bb34322e91f04bf622492c7ea00730ce5c3 Mon Sep 17 00:00:00 2001 From: moonlitusun Date: Thu, 7 Apr 2022 09:16:12 +0800 Subject: [PATCH 13/67] =?UTF-8?q?=E5=AD=90=E6=A8=A1=E7=9A=84=E5=9D=97?= =?UTF-8?q?=E6=8A=80=E5=B7=A7=20=3D>=20=E5=AD=90=E6=A8=A1=E5=9D=97?= =?UTF-8?q?=E7=9A=84=E6=8A=80=E5=B7=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- book/07-git-tools/sections/submodules.asc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/book/07-git-tools/sections/submodules.asc b/book/07-git-tools/sections/submodules.asc index 4b14ca23..0c870205 100644 --- a/book/07-git-tools/sections/submodules.asc +++ b/book/07-git-tools/sections/submodules.asc @@ -787,7 +787,7 @@ $ git commit -am 'Fast forwarded to a common submodule child' 这些命令完成了同一件事,但是通过这种方式你至少可以验证工作是否有效,以及当你在完成时可以确保子模块目录中有你的代码。 -==== 子模的块技巧 +==== 子模块的技巧 你可以做几件事情来让用子模块工作轻松一点儿。 From d01c802fa82ca841b38fc65ec3e61bf4beaa15ff Mon Sep 17 00:00:00 2001 From: yionr Date: Sun, 10 Apr 2022 20:41:07 +0800 Subject: [PATCH 14/67] Update submodules.asc --- book/07-git-tools/sections/submodules.asc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/book/07-git-tools/sections/submodules.asc b/book/07-git-tools/sections/submodules.asc index 0c870205..da15a87e 100644 --- a/book/07-git-tools/sections/submodules.asc +++ b/book/07-git-tools/sections/submodules.asc @@ -446,7 +446,7 @@ nothing to commit, working tree clean 比如,若子模块项目改变了它的托管平台,就会发生这种情况。 此时,若父级项目引用的子模块提交不在仓库中本地配置的子模块远端上,那么执行 `git pull --recurse-submodules` 或 `git submodule update` 就会失败。 -为了补救,`git submodule sync` 命令需要: +为了补救,需要借助 `git submodule sync` 命令: [source,console] ---- From 30dbe412dad777b5a3aacdb4e1609fba650ba05c Mon Sep 17 00:00:00 2001 From: mowangjuanzi Date: Tue, 12 Apr 2022 16:33:15 +0800 Subject: [PATCH 15/67] fix --- book/01-introduction/sections/first-time-setup.asc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/book/01-introduction/sections/first-time-setup.asc b/book/01-introduction/sections/first-time-setup.asc index 0e55acfd..bc9d7c93 100644 --- a/book/01-introduction/sections/first-time-setup.asc +++ b/book/01-introduction/sections/first-time-setup.asc @@ -22,7 +22,7 @@ Git 自带一个 `git config` 的工具来帮助设置控制 Git 外观和行为 在 Windows 系统中,Git 会查找 `$HOME` 目录下(一般情况下是 `C:\Users\$USER` )的 `.gitconfig` 文件。 Git 同样也会寻找 `/etc/gitconfig` 文件,但只限于 MSys 的根目录下,即安装 Git 时所选的目标位置。 如果你在 Windows 上使用 Git 2.x 以后的版本,那么还有一个系统级的配置文件,Windows XP 上在 -`C:\Documents and Settings\All Users\Application Data\Git\config` ,Windows Vista 及更新的版本在 +`C:\Documents and Settings\All Users\Application Data\Git\config` ,Windows Vista 及其以后的版本在 `C:\ProgramData\Git\config` 。此文件只能以管理员权限通过 `git config -f ` 来修改。 你可以通过以下命令查看所有的配置以及它们所在的文件: From 6fdb9b9f7c504e36d92806341aa37109f18f1b5f Mon Sep 17 00:00:00 2001 From: networm Date: Wed, 4 May 2022 19:13:49 +0800 Subject: [PATCH 16/67] Update visualstudio.asc --- .../sections/visualstudio.asc | 30 ++++++++----------- 1 file changed, 12 insertions(+), 18 deletions(-) diff --git a/book/A-git-in-other-environments/sections/visualstudio.asc b/book/A-git-in-other-environments/sections/visualstudio.asc index f676f6d4..bbac5006 100644 --- a/book/A-git-in-other-environments/sections/visualstudio.asc +++ b/book/A-git-in-other-environments/sections/visualstudio.asc @@ -1,25 +1,19 @@ === Visual Studio 中的 Git (((Visual Studio))) -从 Visual Studio 2013 Update 1 版本开始,Visual Studio 用户可以在他们的 IDE 中直接使用内嵌的 Git 客户端。 -Visual Studio 集成源代码版本控制特性已经有很长一段时间,但面向的是集中式、文件锁定方式的系统,Git 并不能很好地符合这种工作流程。 -Visual Studio 2013 中已经支持 Git,并独立于原有版本管理系统,这使得 Visual Studio 和 Git 能更好地相互适应。 +从 Visual Studio 2019 16.8 版本开始,Visual Studio 将 Git 工具直接内置到 IDE 中。 -想要找到这个特性,在 Visual Studio 中打开一个已经用 Git 管理的项目(或者直接在项目目录中 `git init` ),选择菜单 View > Team Explorer。 -你将看到 "Connect" 视图,大概如下图所示: +工具支持以下 Git 功能: -.从 Team Explorer 中连接 Git 仓库。 -image::images/vs-1.png[从 Team Explorer 中连接 Git 仓库。] +* 创建与克隆仓库。 +* 打开与浏览仓库的历史。 +* 创建与检出分支与标签。 +* 储藏、暂存与提交改动。 +* 抓取、拉取、推送或同步提交。 +* 合并与变基分支。 +* 解决合并冲突。 +* 查看差异。 +* ... 等等。 -Visual Studio 能够记住所有你打开过的用 Git 管理的项目,它们都在下方的列表中。 -如果没看到你想要的项目,点击 "Add" 按钮,添加项目工作目录的路径。 -双击其中一个本地的 Git 仓库会将你带入 "Home" 视图,大概如 <> 所示。 -这是一个执行 Git 操作的操作中心;当你 _正在编写_ 代码的时候,你可能主要关注 "Changes" 视图,当需要拉取同伴的改动时,你将使用 "Unsynced Commits" 和 "Branches" 视图。 +阅读 https://docs.microsoft.com/visualstudio/version-control[official documentation^] 以了解更多内容。 -[[vs_home]] -.Visual Studio 中的 Git 仓库的 “Home” 视图。 -image::images/vs-2.png[Visual Studio 中的 Git 仓库的 “Home” 视图。] - -Visual Studio 现在拥有一套着眼于任务的强大 Git 操作界面。 -它包括线性的历史视图、diff 视图、远程仓库操作命令,以及其它很多功能。 -这个特性的完整文档(放在这里并不合适)请参阅 http://msdn.microsoft.com/en-us/library/hh850437.aspx[] 。 From 3138b9d2ca4b3f78378c88819bfcc88f4a5ba6fa Mon Sep 17 00:00:00 2001 From: networm Date: Wed, 4 May 2022 19:14:19 +0800 Subject: [PATCH 17/67] Fix 403 No error links --- book/04-git-server/sections/generating-ssh-key.asc | 2 +- book/06-github/sections/5-scripting.asc | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/book/04-git-server/sections/generating-ssh-key.asc b/book/04-git-server/sections/generating-ssh-key.asc index 178e8108..2d04bda3 100644 --- a/book/04-git-server/sections/generating-ssh-key.asc +++ b/book/04-git-server/sections/generating-ssh-key.asc @@ -58,4 +58,4 @@ NrRFi9wrf+M7Q== schacon@mylaptop.local ---- 关于在多种操作系统中生成 SSH 密钥的更深入教程,请参阅 GitHub 的 SSH 密钥指南 -https://help.github.com/articles/generating-ssh-keys[]。 +https://docs.github.com/cn/authentication/connecting-to-github-with-ssh/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent[]。 diff --git a/book/06-github/sections/5-scripting.asc b/book/06-github/sections/5-scripting.asc index f9d9b660..44f41e88 100644 --- a/book/06-github/sections/5-scripting.asc +++ b/book/06-github/sections/5-scripting.asc @@ -109,7 +109,7 @@ image::images/scripting-04-webhook-debug.png[Web 钩子调试信息] 开发者控制台的另一个很棒的功能是可以轻松地重新发送任何请求来测试你的服务。 关于如何编写 web 钩子与所有可监听的不同事件类型的更多信息,请访问在 -https://developer.github.com/webhooks/[] 的 GitHub 开发者文档。 +https://docs.github.com/cn/developers/webhooks-and-events/webhooks/about-webhooks[] 的 GitHub 开发者文档。 ==== GitHub API @@ -304,4 +304,4 @@ image::images/scripting-07-status.png[提交状态] 访问 https://github.com/octokit[] 了解更多相关信息,它们帮你处理了更多 HTTP 相关的内容。 希望这些工具能帮助你自定义与修改 GitHub 来更好地为特定的工作流程工作。 -关于全部 API 的完整文档与常见任务的指南,请查阅 https://developer.github.com[]。 +关于全部 API 的完整文档与常见任务的指南,请查阅 https://docs.github.com/cn[]。 From 03e3ec091de4b0ec71c05862d17e3b6d111a3983 Mon Sep 17 00:00:00 2001 From: Qiu Chaofan Date: Mon, 26 Sep 2022 15:33:40 +0800 Subject: [PATCH 18/67] Fix typo 'submodle' with 'submodule' --- book/07-git-tools/sections/submodules.asc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/book/07-git-tools/sections/submodules.asc b/book/07-git-tools/sections/submodules.asc index da15a87e..9f97f878 100644 --- a/book/07-git-tools/sections/submodules.asc +++ b/book/07-git-tools/sections/submodules.asc @@ -236,7 +236,7 @@ Fast-forward ---- 如果你现在返回到主项目并运行 `git diff --submodule`,就会看到子模块被更新的同时获得了一个包含新添加提交的列表。 -如果你不想每次运行 `git diff` 时都输入 `--submodle`,那么可以将 `diff.submodule` 设置为 “log” 来将其作为默认行为。 +如果你不想每次运行 `git diff` 时都输入 `--submodule`,那么可以将 `diff.submodule` 设置为 “log” 来将其作为默认行为。 [source,console] ---- From 298c309bab58b30477ff40a45059418ed8e6e723 Mon Sep 17 00:00:00 2001 From: Excimer Gong Date: Sat, 26 Nov 2022 12:08:19 +0800 Subject: [PATCH 19/67] fix link for _core_editor --- C-git-commands.asc | 2 +- book/01-introduction/sections/first-time-setup.asc | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/C-git-commands.asc b/C-git-commands.asc index 405b5375..0068b8d0 100644 --- a/C-git-commands.asc +++ b/C-git-commands.asc @@ -42,7 +42,7 @@ Git 做的很多工作都有一种默认方式。 最后,基本上 <> 整个章节都是针对此命令的。 -[[_core_editor]] +[[ch_core_editor]] ==== git config core.editor 命令 就像 <> 里的设置指示,很多编辑器可以如下设置: diff --git a/book/01-introduction/sections/first-time-setup.asc b/book/01-introduction/sections/first-time-setup.asc index bc9d7c93..74e4be3d 100644 --- a/book/01-introduction/sections/first-time-setup.asc +++ b/book/01-introduction/sections/first-time-setup.asc @@ -77,7 +77,7 @@ $ git config --global core.editor "'C:/Program Files/Notepad++/notepad++.exe' -m ==== Vim、Emacs 和 Notepad++ 都是流行的文本编辑器,通常程序员们会在 Linux 和 macOS 这类基于 Unix 的系统或 Windows 系统上使用它们。 -如果你在使用其他的或 32 位版本的编辑器,请在 <> +如果你在使用其他的或 32 位版本的编辑器,请在 <> 中查看设置为该编辑器的具体步骤。 ==== From b6d096e14216f4af865172d0777c20aa38edc3be Mon Sep 17 00:00:00 2001 From: Excimer Gong Date: Sat, 26 Nov 2022 12:10:19 +0800 Subject: [PATCH 20/67] fix first level --- progit.asc | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/progit.asc b/progit.asc index 9f52e921..22b088b7 100644 --- a/progit.asc +++ b/progit.asc @@ -1,5 +1,4 @@ -Pro Git -======= += Pro Git Scott Chacon; Ben Straub :doctype: book :docinfo: From a11fb45eaa0ec694d0ef3e38d34d4977690704ce Mon Sep 17 00:00:00 2001 From: Jason Date: Fri, 31 Mar 2023 17:25:47 +0800 Subject: [PATCH 21/67] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=BC=8F=E5=AD=97?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 英文原文: This isn’t an exhaustive list of all the environment variables Git pays attention to, but we’ll cover the most useful. --- book/10-git-internals/sections/environment.asc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/book/10-git-internals/sections/environment.asc b/book/10-git-internals/sections/environment.asc index c1997ebf..684ebd7f 100644 --- a/book/10-git-internals/sections/environment.asc +++ b/book/10-git-internals/sections/environment.asc @@ -2,7 +2,7 @@ Git 总是在一个 `bash` shell 中运行,并借助一些 shell 环境变量来决定它的运行方式。 有时候,知道它们是什么以及它们如何让 Git 按照你想要的方式去运行会很有用。 -这里不会列出所有的 Git 环境变量,但我们会涉及最有的那部分。 +这里不会列出所有的 Git 环境变量,但我们会涉及最有用的那部分。 ==== 全局行为 From a79913e23dba29bfeab19b1554b5a855639470e3 Mon Sep 17 00:00:00 2001 From: hasban12138 <1483478664@qq.com> Date: Wed, 29 Nov 2023 11:56:40 +0800 Subject: [PATCH 22/67] =?UTF-8?q?fix=202.2=E7=AB=A0=20=E6=98=9F=E5=8F=B7?= =?UTF-8?q?=EF=BC=88*=EF=BC=89=E6=98=BE=E7=A4=BA=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- book/02-git-basics/sections/recording-changes.asc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/book/02-git-basics/sections/recording-changes.asc b/book/02-git-basics/sections/recording-changes.asc index 62024ba2..aabac575 100644 --- a/book/02-git-basics/sections/recording-changes.asc +++ b/book/02-git-basics/sections/recording-changes.asc @@ -228,11 +228,11 @@ $ cat .gitignore * 要忽略指定模式以外的文件或目录,可以在模式前加上叹号(`!`)取反。 所谓的 glob 模式是指 shell 所使用的简化了的正则表达式。 -星号(`*`)匹配零个或多个任意字符;`[abc]` 匹配任何一个列在方括号中的字符 +星号(`\*`)匹配零个或多个任意字符;`[abc]` 匹配任何一个列在方括号中的字符 (这个例子要么匹配一个 a,要么匹配一个 b,要么匹配一个 c); 问号(`?`)只匹配一个任意字符;如果在方括号中使用短划线分隔两个字符, 表示所有在这两个字符范围内的都可以匹配(比如 `[0-9]` 表示匹配所有 0 到 9 的数字)。 -使用两个星号(`**`)表示匹配任意中间目录,比如 `a/**/z` 可以匹配 `a/z` 、 `a/b/z` 或 `a/b/c/z` 等。 +使用两个星号(`\**`)表示匹配任意中间目录,比如 `a/**/z` 可以匹配 `a/z` 、 `a/b/z` 或 `a/b/c/z` 等。 我们再看一个 `.gitignore` 文件的例子: From b5a21372f59bfdaf533ec1913ffef6c068de7620 Mon Sep 17 00:00:00 2001 From: hasan <1483478664@qq.com> Date: Fri, 1 Dec 2023 00:31:45 +0800 Subject: [PATCH 23/67] =?UTF-8?q?rm=20=E5=88=A0=E9=99=A4bzr=E5=92=8Ctfs=20?= =?UTF-8?q?=E5=90=8C=E5=8E=9F=E7=89=88=E4=BF=9D=E6=8C=81=E4=B8=80=E8=87=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../sections/client-bzr.asc | 130 ------ .../sections/client-tfs.asc | 419 ------------------ .../sections/import-bzr.asc | 145 ------ .../sections/import-tfs.asc | 60 --- ch09-git-and-other-systems.asc | 8 - 5 files changed, 762 deletions(-) delete mode 100644 book/09-git-and-other-scms/sections/client-bzr.asc delete mode 100644 book/09-git-and-other-scms/sections/client-tfs.asc delete mode 100644 book/09-git-and-other-scms/sections/import-bzr.asc delete mode 100644 book/09-git-and-other-scms/sections/import-tfs.asc diff --git a/book/09-git-and-other-scms/sections/client-bzr.asc b/book/09-git-and-other-scms/sections/client-bzr.asc deleted file mode 100644 index 3487f9ba..00000000 --- a/book/09-git-and-other-scms/sections/client-bzr.asc +++ /dev/null @@ -1,130 +0,0 @@ -==== Git and Bazaar - -Among the DVCS, another famous one is http://bazaar.canonical.com[Bazaar]. -Bazaar is free and open source, and is part of the https://www.gnu.org[GNU Project]. -It behaves very differently from Git. -Sometimes, to do the same thing as with Git, you have to use a different keyword, and some keywords that are common don't have the same meaning. -In particular, the branch management is very different and may cause confusion, especially when someone comes from Git's universe. -Nevertheless, it is possible to work on a Bazaar repository from a Git one. - -There are many projects that allow you to use Git as a Bazaar client. -Here we'll use Felipe Contreras' project that you may find at https://github.com/felipec/git-remote-bzr[]. -To install it, you just have to download the file git-remote-bzr in a folder contained in your `$PATH`: -[source,console] ----- -$ wget https://raw.github.com/felipec/git-remote-bzr/master/git-remote-bzr -O ~/bin/git-remote-bzr -$ chmod +x ~/bin/git-remote-bzr ----- - -You also need to have Bazaar installed. -That's all! - -===== Create a Git repository from a Bazaar repository - -It is simple to use. -It is enough to clone a Bazaar repository prefixing it by `bzr::`. -Since Git and Bazaar both do full clones to your machine, it's possible to attach a Git clone to your local Bazaar clone, but it isn't recommended. -It's much easier to attach your Git clone directly to the same place your Bazaar clone is attached to ‒ the central repository. - -Let's suppose that you worked with a remote repository which is at address `bzr+ssh://developer@mybazaarserver:myproject`. -Then you must clone it in the following way: -[source,console] ----- -$ git clone bzr::bzr+ssh://developer@mybazaarserver:myproject myProject-Git -$ cd myProject-Git ----- - -At this point, your Git repository is created but it is not compacted for optimal disk use. -That's why you should also clean and compact your Git repository, especially if it is a big one: -[source,console] ----- -$ git gc --aggressive ----- - -===== Bazaar branches - -Bazaar only allows you to clone branches, but a repository may contain several branches, and `git-remote-bzr` can clone both. -For example, to clone a branch: -[source,console] ----- -$ git clone bzr::bzr://bzr.savannah.gnu.org/emacs/trunk emacs-trunk ----- - -And to clone the whole repository: -[source,console] ----- -$ git clone bzr::bzr://bzr.savannah.gnu.org/emacs emacs ----- - -The second command clones all the branches contained in the emacs repository; nevertheless, it is possible to point out some branches: -[source,console] ----- -$ git config remote-bzr.branches 'trunk, xwindow' ----- - -Some remote repositories don't allow you to list their branches, in which case you have to manually specify them, and even though you could specify the configuration in the cloning command, you may find this easier: - -[source,console] ----- -$ git init emacs -$ git remote add origin bzr::bzr://bzr.savannah.gnu.org/emacs -$ git config remote-bzr.branches 'trunk, xwindow' -$ git fetch ----- - -===== Ignore what is ignored with .bzrignore - -Since you are working on a project managed with Bazaar, you shouldn't create a `.gitignore` file because you _may_ accidentally set it under version control and the other people working with Bazaar would be disturbed. -The solution is to create the `.git/info/exclude` file either as a symbolic link or as a regular file. -We'll see later on how to solve this question. - -Bazaar uses the same model as Git to ignore files, but also has two features which don't have an equivalent into Git. -The complete description may be found in http://doc.bazaar.canonical.com/bzr.2.7/en/user-reference/ignore-help.html[the documentation]. -The two features are: - -1. "!!" allows you to ignore certain file patterns even if they're specified using a "!" rule. -2. "RE:" at the beginning of a line allows you to specify a https://docs.python.org/3/library/re.html[Python regular expression] (Git only allows shell globs). - -As a consequence, there are two different situations to consider: - -1. If the `.bzrignore` file does not contain any of these two specific prefixes, then you can simply make a symbolic link to it in the repository: `ln -s .bzrignore .git/info/exclude` -2. Otherwise, you must create the `.git/info/exclude` file and adapt it to ignore exactly the same files in `.bzrignore`. - -Whatever the case is, you will have to remain vigilant against any change of `.bzrignore` to make sure that the `.git/info/exclude` file always reflects `.bzrignore`. -Indeed, if the `.bzrignore` file were to change and contained one or more lines starting with "!!" or "RE:", Git not being able to interpret these lines, you'll have to adapt your `.git/info/exclude` file to ignore the same files as the ones ignored with `.bzrignore`. -Moreover, if the `.git/info/exclude` file was a symbolic link, you'll have to first delete the symbolic link, copy `.bzrignore` to `.git/info/exclude` and then adapt the latter. -However, be careful with its creation because with Git it is impossible to re-include a file if a parent directory of that file is excluded. - -===== Fetch the changes of the remote repository - -To fetch the changes of the remote, you pull changes as usually, using Git commands. -Supposing that your changes are on the `master` branch, you merge or rebase your work on the `origin/master` branch: -[source,console] ----- -$ git pull --rebase origin ----- - -===== Push your work on the remote repository - -Because Bazaar also has the concept of merge commits, there will be no problem if you push a merge commit. -So you can work on a branch, merge the changes into `master` and push your work. -Then, you create your branches, you test and commit your work as usual. -You finally push your work to the Bazaar repository: -[source,console] ----- -$ git push origin master ----- - -===== Caveats - -Git's remote-helpers framework has some limitations that apply. -In particular, these commands don't work: - -* git push origin :branch-to-delete (Bazaar can't accept ref deletions in this way.) -* git push origin old:new (it will push 'old') -* git push --dry-run origin branch (it will push) - -===== Summary - -Since Git's and Bazaar's models are similar, there isn't a lot of resistance when working across the boundary. -As long as you watch out for the limitations, and are always aware that the remote repository isn't natively Git, you'll be fine. diff --git a/book/09-git-and-other-scms/sections/client-tfs.asc b/book/09-git-and-other-scms/sections/client-tfs.asc deleted file mode 100644 index 503e192a..00000000 --- a/book/09-git-and-other-scms/sections/client-tfs.asc +++ /dev/null @@ -1,419 +0,0 @@ -==== Git 与 TFS - -(((Interoperation with other VCSs, TFS))) -(((TFS)))((("TFVC", see="TFS"))) -Git 在 Windows 开发者当中变得流行起来,如果你正在 Windows 上编写代码并且正在使用 Microsoft 的 Team Foundation Server (TFS),这会是个好机会。 -TFS 是一个包含工作项目检测与跟踪、支持 Scrum 与其他流程管理方法、代码审核、版本控制的协作套件。 -这里有一点困惑:*TFS* 是服务器,它支持通过 Git 与它们自定义的 VCS 来管理源代码,这被他们称为 *TFVC*(Team Foundation Version Control)。 -Git 支持 TFS(自 2013 版本起)的部分新功能,所以在那之前所有工具都将版本控制部分称为 “TFS”,即使实际上他们大部分时间都在与 TFVC 工作。 - -如果发现你的团队在使用 TFVC 但是你更愿意使用 Git 作为版本控制客户端,这里为你准备了一个项目。 - -===== 选择哪个工具 - -(((git-tf)))(((git-tfs))) -实际上,这里有两个工具:git-tf 与 git-tfs。 - -Git-tfs (可以在 https://github.com/git-tfs/git-tfs[] 找到)是一个 .NET 项目,它只能运行在 Windows 上(截至文章完成时)。 -为了操作 Git 仓库,它使用了 libgit2 的 .NET 绑定,一个可靠的面向库的 Git 实现,十分灵活且性能优越。 -Libgit2 并不是一个完整的 Git 实现,为了弥补差距 git-tfs 实际上会调用 Git 命令行客户端来执行某些操作,因此在操作 Git 仓库时并没有任何功能限制。 -因为它使用 Visual Studio 程序集对服务器进行操作,所以它对 TFVC 的支持非常成熟。 -这并不意味着你需要接触那些程序集,但是意味着你需要安装 Visual Studio 的一个最近版本(2010 之后的任何版本,包括 2012 之后的 Express 版本),或者 Visual Studio SDK。 - -[CAUTION] -==== -Git-tf 已经停止开发,它不会再得到任何更新。它也不再受到微软的支持。 -==== - -Git-tf(主页在 https://archive.codeplex.com/?p=gittf[])是一个 Java 项目, -因此它可以运行在任何一个有 Java 运行时环境的电脑上。 -它通过 JGit(一个 Git 的 JVM 实现)来与 Git 仓库交互,这意味着事实上它没有 Git 功能上的限制。 -然而,相对于 git-tfs 它对 TFVC 的支持是有限的——例如,它不支持分支。 - -所以每个工具都有优点和缺点,每个工具都有它适用的情况。 -我们在本书中将会介绍它们两个的基本用法。 - -[NOTE] -==== -你需要有一个基于 TFVC 的仓库来执行后续的指令。 -现实中它们并没有 Git 或 Subversion 仓库那样多,所以你可能需要创建一个你自己的仓库。 -Codeplex (https://archive.codeplex.com/) 或 Visual Studio Online (http://www.visualstudio.com[]) 都是非常好的选择。 -==== - - -===== 使用:`git-tf` - -和其它任何 Git 项目一样,你要做的第一件事是克隆。 -使用 `git-tf` 克隆看起来像这样: - -[source,console] ----- -$ git tf clone https://tfs.codeplex.com:443/tfs/TFS13 $/myproject/Main project_git ----- - -第一个参数是一个 TFVC 集的 URL,第二个参数类似于 `$/project/branch` 的形式,第三个参数是将要创建的本地 Git 仓库路径(最后一项可以省略)。 -Git-tf 同一时间只能工作在一个分支上;如果你想要检入一个不同的 TFVC 分支,你需要从那个分支克隆一份新的。 - -这会创建一个完整功能的 Git 仓库: - -[source,console] ----- -$ cd project_git -$ git log --all --oneline --decorate -512e75a (HEAD, tag: TFS_C35190, origin_tfs/tfs, master) Checkin message ----- - -这叫做 _浅_ 克隆,意味着只下载了最新的变更集。 -TFVC 并未设计成为每一个客户端提供一份全部历史记录的拷贝,所以 git-tf 默认行为是获得最新的版本,这样更快一些。 - -如果愿意多花一些时间,使用 `--deep` 选项克隆整个项目历史可能更有价值。 - -[source,console] ----- -$ git tf clone https://tfs.codeplex.com:443/tfs/TFS13 $/myproject/Main \ - project_git --deep -Username: domain\user -Password: -Connecting to TFS... -Cloning $/myproject into /tmp/project_git: 100%, done. -Cloned 4 changesets. Cloned last changeset 35190 as d44b17a -$ cd project_git -$ git log --all --oneline --decorate -d44b17a (HEAD, tag: TFS_C35190, origin_tfs/tfs, master) Goodbye -126aa7b (tag: TFS_C35189) -8f77431 (tag: TFS_C35178) FIRST -0745a25 (tag: TFS_C35177) Created team project folder $/tfvctest via the \ - Team Project Creation Wizard ----- - -注意名字类似 `TFS_C35189` 的标签;这是一个帮助你知道 Git 提交与 TFVC 变更集关联的功能。 -这是一种优雅的表示方式,因为通过一个简单的 log 命令就可以看到你的提交是如何与 TFVC 中已存在快照关联起来的。 -它们并不是必须的(并且实际上可以使用 `git config git-tf.tag false` 来关闭它们)- git-tf 会在 `.git/git-tf` 文件中保存真正的提交与变更集的映射。 - - -===== 使用:`git-tfs` - -Git-tfs 克隆行为略为不同。 -观察: - -[source,powershell] ----- -PS> git tfs clone --with-branches \ - https://username.visualstudio.com/DefaultCollection \ - $/project/Trunk project_git -Initialized empty Git repository in C:/Users/ben/project_git/.git/ -C15 = b75da1aba1ffb359d00e85c52acb261e4586b0c9 -C16 = c403405f4989d73a2c3c119e79021cb2104ce44a -Tfs branches found: -- $/tfvc-test/featureA -The name of the local branch will be : featureA -C17 = d202b53f67bde32171d5078968c644e562f1c439 -C18 = 44cd729d8df868a8be20438fdeeefb961958b674 ----- - -注意 `--with-branches` 选项。 -Git-tfs 能够映射 TFVC 分支到 Git 分支,这个标记告诉它为每一个 TFVC 分支建立一个本地的 Git 分支。 -强烈推荐曾经在 TFS 中新建过分支或合并过分支的仓库使用这个标记,但是如果使用的服务器的版本比 TFS 2010 更老——在那个版本前,“分支”只是文件夹,所以 git-tfs 无法将它们与普通文件夹区分开。 - -让我们看一下最终的 Git 仓库: - -[source,powershell] ----- -PS> git log --oneline --graph --decorate --all -* 44cd729 (tfs/featureA, featureA) Goodbye -* d202b53 Branched from $/tfvc-test/Trunk -* c403405 (HEAD, tfs/default, master) Hello -* b75da1a New project -PS> git log -1 -commit c403405f4989d73a2c3c119e79021cb2104ce44a -Author: Ben Straub -Date: Fri Aug 1 03:41:59 2014 +0000 - - Hello - - git-tfs-id: [https://username.visualstudio.com/DefaultCollection]$/myproject/Trunk;C16 ----- - -有两个本地分支,`master` 与 `featureA`,分别代表着克隆(TFVC 中的 `Trunk`)与子分支(TFVC 中的 `featureA`)的初始状态。 -也可以看到 `tfs` “remote” 也有一对引用:`default` 与 `featureA`,代表 TFVC 分支。 -Git-tfs 映射从 `tfs/default` 克隆的分支,其他的会有它们自己的名字。 - -另一件需要注意的事情是在提交信息中的 `git-tfs-id:` 行。 -Git-tfs 使用这些标记而不是标签来关联 TFVC 变更集与 Git 提交。 -有一个潜在的问题是 Git 提交在推送到 TFVC 前后会有不同的 SHA-1 校验和。 - -===== Git-tf[s] 工作流程 - -[NOTE] -==== -无论你使用哪个工具,都需要先设置几个 Git 配置选项来避免一些问题。 - -[source,console] ----- -$ git config set --local core.ignorecase=true -$ git config set --local core.autocrlf=false ----- -==== - -显然,接下来要做的事情就是要在项目中做一些工作。 -TFVC 与 TFS 有几个功能可能会增加你的工作流程的复杂性: - -. TFVC 无法表示主题分支,这会增加一点复杂度。 - 这会导致需要以 *非常* 不同的方式使用 TFVC 与 Git 表示的分支。 -. 要意识到 TFVC 允许用户从服务器上“检出”文件并锁定它们,这样其他人就无法编辑了。 - 显然它不会阻止你在本地仓库中编辑它们,但是当推送你的修改到 TFVC 服务器时会出现问题。 -. TFS 有一个“封闭”检入的概念,TFS 构建-测试循环必须在检入被允许前成功完成。 - 这使用了 TFVC 的“shelve”功能,我们不会在这里详述。 - 可以通过 git-tf 手动地模拟这个功能,并且 git-tfs 提供了封闭敏感的 `checkintool` 命令。 - -出于简洁性的原因,我们这里介绍的是一种轻松的方式,回避并避免了大部分问题。 - -===== 工作流程:`git-tf` - - -假定你完成了一些工作,在 `master` 中做了几次 Git 提交,然后准备将你的进度共享到服务器。 -这是我们的 Git 仓库: - -[source,console] ----- -$ git log --oneline --graph --decorate --all -* 4178a82 (HEAD, master) update code -* 9df2ae3 update readme -* d44b17a (tag: TFS_C35190, origin_tfs/tfs) Goodbye -* 126aa7b (tag: TFS_C35189) -* 8f77431 (tag: TFS_C35178) FIRST -* 0745a25 (tag: TFS_C35177) Created team project folder $/tfvctest via the \ - Team Project Creation Wizard ----- - -我们想要拿到在 `4178a82` 提交的快照并将其推送到 TFVC 服务器。 -先说重要的:让我们看看自从上次连接后我们的队友是否进行过改动: - -[source,console] ----- -$ git tf fetch -Username: domain\user -Password: -Connecting to TFS... -Fetching $/myproject at latest changeset: 100%, done. -Downloaded changeset 35320 as commit 8ef06a8. Updated FETCH_HEAD. -$ git log --oneline --graph --decorate --all -* 8ef06a8 (tag: TFS_C35320, origin_tfs/tfs) just some text -| * 4178a82 (HEAD, master) update code -| * 9df2ae3 update readme -|/ -* d44b17a (tag: TFS_C35190) Goodbye -* 126aa7b (tag: TFS_C35189) -* 8f77431 (tag: TFS_C35178) FIRST -* 0745a25 (tag: TFS_C35177) Created team project folder $/tfvctest via the \ - Team Project Creation Wizard ----- - -看起来其他人也做了一些改动,现在我们有一个分叉的历史。 -这就是 Git 的优势,但是我们现在有两种处理的方式: - -. 像一名 Git 用户一样自然的生成一个合并提交(毕竟,那也是 `git pull` 做的),git-tf 可以通过一个简单的 `git tf pull` 来帮你完成。 - 然而,我们要注意的是,TFVC 却并不这样想,如果你推送合并提交那么你的历史在两边看起来都不一样,这会造成困惑。 - 其次,如果你计划将所有你的改动提交为一次变更集,这可能是最简单的选择。 -. 变基使我们的提交历史变成直线,这意味着我们有个选项可以将我们的每一个 Git 提交转换为一个 TFVC 变更集。 - 因为这种方式为其他选项留下了可能,所以我们推荐你这样做;git-tf 可以很简单地通过 `git tf pull --rebase` 帮你达成目标。 - -这是你的选择。 -在本例中,我们会进行变基: - -[source,console] ----- -$ git rebase FETCH_HEAD -First, rewinding head to replay your work on top of it... -Applying: update readme -Applying: update code -$ git log --oneline --graph --decorate --all -* 5a0e25e (HEAD, master) update code -* 6eb3eb5 update readme -* 8ef06a8 (tag: TFS_C35320, origin_tfs/tfs) just some text -* d44b17a (tag: TFS_C35190) Goodbye -* 126aa7b (tag: TFS_C35189) -* 8f77431 (tag: TFS_C35178) FIRST -* 0745a25 (tag: TFS_C35177) Created team project folder $/tfvctest via the \ - Team Project Creation Wizard ----- - -现在我们准备好生成一个检入来推送到 TFVC 服务器上了。 -Git-tf 给你一个将自上次修改(即 `--shallow` 选项,默认启用)以来所有的修改生成的一个单独的变更集以及为每一个 Git 提交(`--deep`)生成的一个新的变更集。 -在本例中,我们将会创建一个变更集: - -[source,console] ----- -$ git tf checkin -m 'Updating readme and code' -Username: domain\user -Password: -Connecting to TFS... -Checking in to $/myproject: 100%, done. -Checked commit 5a0e25e in as changeset 35348 -$ git log --oneline --graph --decorate --all -* 5a0e25e (HEAD, tag: TFS_C35348, origin_tfs/tfs, master) update code -* 6eb3eb5 update readme -* 8ef06a8 (tag: TFS_C35320) just some text -* d44b17a (tag: TFS_C35190) Goodbye -* 126aa7b (tag: TFS_C35189) -* 8f77431 (tag: TFS_C35178) FIRST -* 0745a25 (tag: TFS_C35177) Created team project folder $/tfvctest via the \ - Team Project Creation Wizard ----- - -那有一个新标签 `TFS_C35348`,表明 TFVC 已经存储了一个相当于 `5a0e25e` 提交的快照。 -要重点注意的是,不是每一个 Git 提交都需要在 TFVC 中存在一个相同的副本;例如 `6eb3eb5` 提交,在服务器上并不存在。 - -这就是主要的工作流程。 -有一些你需要考虑的其他注意事项: - -* 没有分支。 - Git-tf 同一时间只能从一个 TFVC 分支创建一个 Git 仓库。 -* 协作时使用 TFVC 或 Git,而不是两者同时使用。 - 同一个 TFVC 仓库的不同 git-tf 克隆会有不同的 SHA-1 校验和,这会导致无尽的头痛问题。 -* 如果你的团队的工作流程包括在 Git 中协作并定期与 TFVC 同步,只能使用其中的一个 Git 仓库连接到 TFVC。 - -===== 工作流程:`git-tfs` - -让我们使用 git-tfs 来走一遍同样的情景。 -这是我们在 Git 仓库中 `master` 分支上生成的几个新提交: - -[source,powershell] ----- -PS> git log --oneline --graph --all --decorate -* c3bd3ae (HEAD, master) update code -* d85e5a2 update readme -| * 44cd729 (tfs/featureA, featureA) Goodbye -| * d202b53 Branched from $/tfvc-test/Trunk -|/ -* c403405 (tfs/default) Hello -* b75da1a New project ----- - -让我们看一下在我们工作时有没有人完成一些其它的工作: - -[source,powershell] ----- -PS> git tfs fetch -C19 = aea74a0313de0a391940c999e51c5c15c381d91d -PS> git log --all --oneline --graph --decorate -* aea74a0 (tfs/default) update documentation -| * c3bd3ae (HEAD, master) update code -| * d85e5a2 update readme -|/ -| * 44cd729 (tfs/featureA, featureA) Goodbye -| * d202b53 Branched from $/tfvc-test/Trunk -|/ -* c403405 Hello -* b75da1a New project ----- - -是的,那说明我们的同事增加了一个新的 TFVC 变更集,显示为新的 `aea74a0` 提交,而 `tfs/default` 远程分支已经被移除了。 - -与 git-tf 相同,我们有两种基础选项来解决这个分叉历史问题: - -. 通过变基来保持历史是线性的。 -. 通过合并来保留改动。 - -在本例中,我们将要做一个“深”检入,也就是说每一个 Git 提交会变成一个 TFVC 变更集,所以我们想要变基。 - -[source,powershell] ----- -PS> git rebase tfs/default -First, rewinding head to replay your work on top of it... -Applying: update readme -Applying: update code -PS> git log --all --oneline --graph --decorate -* 10a75ac (HEAD, master) update code -* 5cec4ab update readme -* aea74a0 (tfs/default) update documentation -| * 44cd729 (tfs/featureA, featureA) Goodbye -| * d202b53 Branched from $/tfvc-test/Trunk -|/ -* c403405 Hello -* b75da1a New project ----- - -现在已经准备好通过检入我们的代码到 TFVC 服务器来完成贡献。 -我们这里将会使用 `rcheckin` 命令将 HEAD 到第一个 `tfs` 远程分支间的每一个 Git 提交转换为一个 TFVC 变更集(`checkin` 命令只会创建一个变更集,有些类似于压缩 Git 提交)。 - -[source,powershell] ----- -PS> git tfs rcheckin -Working with tfs remote: default -Fetching changes from TFS to minimize possibility of late conflict... -Starting checkin of 5cec4ab4 'update readme' - add README.md -C20 = 71a5ddce274c19f8fdc322b4f165d93d89121017 -Done with 5cec4ab4b213c354341f66c80cd650ab98dcf1ed, rebasing tail onto new TFS-commit... -Rebase done successfully. -Starting checkin of b1bf0f99 'update code' - edit .git\tfs\default\workspace\ConsoleApplication1/ConsoleApplication1/Program.cs -C21 = ff04e7c35dfbe6a8f94e782bf5e0031cee8d103b -Done with b1bf0f9977b2d48bad611ed4a03d3738df05ea5d, rebasing tail onto new TFS-commit... -Rebase done successfully. -No more to rcheckin. -PS> git log --all --oneline --graph --decorate -* ff04e7c (HEAD, tfs/default, master) update code -* 71a5ddc update readme -* aea74a0 update documentation -| * 44cd729 (tfs/featureA, featureA) Goodbye -| * d202b53 Branched from $/tfvc-test/Trunk -|/ -* c403405 Hello -* b75da1a New project ----- - -注意在每次成功检入到 TFVC 服务器后,git-tfs 是如何将剩余的工作变基到服务器上。 -这是因为它将 `git-tfs-id` 属性加入到提交信息的底部,这将会改变 SHA-1 校验和。 -这恰恰是有意设计的,没有什么事情可以担心了,但是你应该意识到发生了什么,特别是当你想要与其他人共享 Git 提交时。 - -TFS 有许多与它的版本管理系统整合的功能,比如工作项目、指定审核者、封闭检入等等。 -仅仅通过命令行工具使用这些功能来工作是很笨重的,但是幸运的是 git-tfs 允许你轻松地运行一个图形化的检入工具: - -[source,powershell] ----- -PS> git tfs checkintool -PS> git tfs ct ----- - -它看起来有点像这样: - -.git-tfs 检入工具。 -image::images/git-tfs-ct.png[git-tfs 检入工具。] - -对 TFS 用户来说这看起来很熟悉,因为它就是从 Visual Studio 中运行的同一个窗口。 - -Git-tfs 同样允许你从你的 Git 仓库控制 TFVC 分支。 -如同这个例子,让我们创建一个: - -[source,powershell] ----- -PS> git tfs branch $/tfvc-test/featureBee -The name of the local branch will be : featureBee -C26 = 1d54865c397608c004a2cadce7296f5edc22a7e5 -PS> git log --oneline --graph --decorate --all -* 1d54865 (tfs/featureBee) Creation branch $/myproject/featureBee -* ff04e7c (HEAD, tfs/default, master) update code -* 71a5ddc update readme -* aea74a0 update documentation -| * 44cd729 (tfs/featureA, featureA) Goodbye -| * d202b53 Branched from $/tfvc-test/Trunk -|/ -* c403405 Hello -* b75da1a New project ----- - -在 TFVC 中创建一个分支意味着增加一个使分支存在的变更集,这会映射为一个 Git 提交。 -也要注意的是 git-tfs *创建* 了 `tfs/featureBee` 远程分支,但是 `HEAD` 始终指向 `master`。 -如果你想要在新生成的分支上工作,那你也许应该通过从那次提交创建一个主题分支的方式使你新的提交基于 `1d54865` 提交。 - -===== Git 与 TFS 总结 - -Git-tf 与 Git-tfs 都是与 TFVC 服务器交互的很好的工具。 -它们允许你在本地使用 Git 的能力,避免与中央 TFVC 服务器频繁交流, -使你做为一个开发者的生活更轻松,而不用强制整个团队迁移到 Git。 -如果你在 Windows 上工作(那很有可能你的团队正在使用 TFS),你可能会想要使用 git-tfs, -因为它的功能更完整,但是如果你在其他平台工作,你只能使用略有限制的 git-tf。 -像本章中大多数工具一样,你应当使用其中的一个版本系统作为主要的, -而使用另一个做为次要的——不管是 Git 还是 TFVC 都可以做为协作中心,但不是两者都用。 diff --git a/book/09-git-and-other-scms/sections/import-bzr.asc b/book/09-git-and-other-scms/sections/import-bzr.asc deleted file mode 100644 index ebacea0a..00000000 --- a/book/09-git-and-other-scms/sections/import-bzr.asc +++ /dev/null @@ -1,145 +0,0 @@ -==== Bazaar -(((Bazaar)))(((Importing, from Bazaar))) - -Bazaar 是一个和 Git 非常类似的分布式版本控制系统(DVCS),因此将 Bazzar 仓库转换成 Git 仓库是非常简单易懂的。想要完成转换,你需要安装 `bzr-fastimport` 插件。 - -===== 安装 bzr-fastimport 插件 - -安装 fastimport 插件的步骤在类 UNIX 操作系统和 Windows 上是不一样的。在类 UNIX 系统上,最简单的办法就是安装 `bzr-fastimport` 包,这种方法将会自动安装所有需要的依赖。 - -例如,使用 Debian 及其派生系统,你只需要进行以下操作: - -[source,console] ----- -$ sudo apt-get install bzr-fastimport ----- - -红帽企业版系统(RHEL),使用以下命令: - -[source,console] ----- -$ sudo yum install bzr-fastimport ----- - -Fedora 从 22 版本开始,采用了新的包管理器 dnf,使用以下命令: - -[source,console] ----- -$ sudo dnf install bzr-fastimport ----- - -如果直接安装包的方法不行,你可能需要使用安装插件的方法: - -[source,console] ----- -$ mkdir --parents ~/.bazaar/plugins # 为插件创建必要的文件夹 -$ cd ~/.bazaar/plugins -$ bzr branch lp:bzr-fastimport fastimport # 引入 fastimport 插件 -$ cd fastimport -$ sudo python setup.py install --record=files.txt # 安装插件 ----- - -为了确保插件工作,你同时也需要安装有 `fastimport` 这一 Python 模块。使用下面的命令可以检查这一模块安装与否,如果没有则安装这一模块: - -[source,console] ----- -$ python -c "import fastimport" -Traceback (most recent call last): - File "", line 1, in -ImportError: No module named fastimport -$ pip install fastimport ----- -如果上面的命令安装失败,你可以直接到这个地址下载 https://pypi.python.org/pypi/fastimport/ 。 - -在 Windows 上,`bzr-fastimport` 插件在 Git 使用脱机安装并保持默认安装选项不变(可选框全部选中)的情况下是自动安装的。在这种情况下,你什么都不用做。 - -接下来,导入 Bazaar 仓库的方法根据你的仓库是有一个分支还是有多个分支而不同。 - -===== 单分支项目 - -`cd` 到包含你的 Bazaar 仓库的路径,然后初始化 Git 仓库: - -[source,console] ----- -$ cd /path/to/the/bzr/repository -$ git init ----- - -现在你可以使用以下命令轻松地导出你的 Bazaar 仓库并把它转化成 Git 仓库: - -[source,console] ----- -$ bzr fast-export --plain . | git fast-import ----- - -根据项目的大小,Git 仓库会在几秒钟到几分钟之间构建。 - -===== 多分支项目 - -你同样也能够导入包含多个分支的 Bazaar 仓库。让我们假设你有两个分支,一个代表主分支(myProject.trunk),另一个是工作分支(myProject.work)。 - -[source,console] ----- -$ ls -myProject.trunk myProject.work ----- - -创建一个 Git 仓库并 `cd` 进去: - -[source,console] ----- -$ git init git-repo -$ cd git-repo ----- - -将 `master` 分支拉入 Git: - -[source,console] ----- -$ bzr fast-export --export-marks=../marks.bzr ../myProject.trunk | \ -git fast-import --export-marks=../marks.git ----- - -将工作分支拉入 Git: - -[source,console] ----- -$ bzr fast-export --marks=../marks.bzr --git-branch=work ../myProject.work | \ -git fast-import --import-marks=../marks.git --export-marks=../marks.git ----- - -现在 `git branch` 会同时显示 `master` 分支和 `work` 分支。检查日志以确保它们是完整的,并删除 `marks.bzr` 和 `marks.git` 文件。 - -===== 同步暂存区 -无论你有多少分支以及使用的导入方法如何,你的暂存区都不会与 `HEAD` 同步,并且在导入多个分支时,你的工作目录也不会同步。这种情况使用下面的命令可以轻松解决: - -[source,console] ----- -$ git reset --hard HEAD ----- - -===== 忽略被 .bzrignore 文件指明忽略的文件 -现在让我们看看要忽略的文件。第一件事情就是将 `.bzrignore` 重命名为 `.gitignore`。如果 `.bzrignore` 文件里面有一行或数行以“!!”或“RE:”开头的内容,你必须修改它,并且可能还要创建几个 `.gitignore` 文件,以便忽略与 Bazaar 忽略的文件完全相同的文件。 - -最后,你必须创建一个提交,其中包含此次迁移的修改。 - -[source,console] ----- -$ git mv .bzrignore .gitignore -$ # modify .gitignore if needed -$ git commit -am 'Migration from Bazaar to Git' ----- - -===== 推送你的仓库到服务器 - -终于到这一步了! -现在你可以推送仓库到它的“云端新家”了: - -[source,console] ----- -$ git remote add origin git@my-git-server:mygitrepository.git -$ git push origin --all -$ git push origin --tags ----- - -你的 Git 仓库准备就绪。 diff --git a/book/09-git-and-other-scms/sections/import-tfs.asc b/book/09-git-and-other-scms/sections/import-tfs.asc deleted file mode 100644 index 7d2aaeda..00000000 --- a/book/09-git-and-other-scms/sections/import-tfs.asc +++ /dev/null @@ -1,60 +0,0 @@ -[[_git_tfs]] -==== TFS - -(((TFS)))(((Importing, from TFS))) -如果你的团队正在将他们的源代码管理从 TFVC 转换为 Git,你们会想要最高程度的无损转换。 -这意味着,虽然我们在之前的交互章节介绍了 git-tfs 与 git-tf 两种工具,但是我们在本部分只能介绍 git-tfs,因为 git-tfs 支持分支,而使用 git-tf 代价太大。 - -[NOTE] -==== -这是一个单向转换。 -这意味着 Git 仓库无法连接到原始的 TFVC 项目。 -==== - -第一件事是映射用户名。 -TFVC 对待变更集作者字段的内容相当宽容,但是 Git 需要人类可读的名字与邮箱地址。 -可以通过 `tf` 命令行客户端来获取这个信息,像这样: - -[source,powershell] ----- -PS> tf history $/myproject -recursive > AUTHORS_TMP ----- - -这会将历史中的所有变更集抓取下来并放到 AUTHORS_TMP 文件中,然后我们将会将 `User` 列(第二个)取出来。 -打开文件找到列开始与结束的字符并替换,在下面的命令行中,`cut` 命令的参数 `11-20` 就是我们找到的: - -[source,powershell] ----- -PS> cat AUTHORS_TMP | cut -b 11-20 | tail -n+3 | sort | uniq > AUTHORS ----- - -`cut` 命令只会保留每行中第 11 个到第 22 个字符。 -`tail` 命令会跳过前两行,就是字段表头与 ASCII 风格的下划线。 -所有这些的结果通过管道送到 `sort` 和 `uniq` 来去除重复,然后保存到 `AUTOHRS` 文件中。 -下一步是手动的;为了让 git-tfs 有效地使用这个文件,每一行必须是这种格式: - -[source,text] ----- -DOMAIN\username = User Name ----- - -左边的部分是 TFVC 中的 “User” 字段,等号右边的部分是将被用作 Git 提交的用户名。 - -一旦有了这个文件,下一件事就是生成一个你需要的 TFVC 项目的完整克隆: - -[source,powershell] ----- -PS> git tfs clone --with-branches --authors=AUTHORS https://username.visualstudio.com/DefaultCollection $/project/Trunk project_git ----- - -接下来要从提交信息底部清理 `git-tfs-id` 区块。 -下面的命令会完成这个任务: - -[source,powershell] ----- -PS> git filter-branch -f --msg-filter 'sed "s/^git-tfs-id:.*$//g"' '--' --all ----- - -那会使用 Git 终端环境中的 `sed` 命令来将所有以 “git-tfs-id:” 开头的行替换为 Git 会忽略的空白。 - -全部完成后,你就已经准备好去增加一个新的远程仓库,推送你所有的分支上去,然后你的团队就可以开始用 Git 工作了。 diff --git a/ch09-git-and-other-systems.asc b/ch09-git-and-other-systems.asc index 1cb22858..5d886c3d 100644 --- a/ch09-git-and-other-systems.asc +++ b/ch09-git-and-other-systems.asc @@ -20,12 +20,8 @@ include::book/09-git-and-other-scms/sections/client-svn.asc[] include::book/09-git-and-other-scms/sections/client-hg.asc[] -include::book/09-git-and-other-scms/sections/client-bzr.asc[] - include::book/09-git-and-other-scms/sections/client-p4.asc[] -include::book/09-git-and-other-scms/sections/client-tfs.asc[] - [[_migrating]] === 迁移到 Git @@ -38,12 +34,8 @@ include::book/09-git-and-other-scms/sections/import-svn.asc[] include::book/09-git-and-other-scms/sections/import-hg.asc[] -include::book/09-git-and-other-scms/sections/import-bzr.asc[] - include::book/09-git-and-other-scms/sections/import-p4.asc[] -include::book/09-git-and-other-scms/sections/import-tfs.asc[] - include::book/09-git-and-other-scms/sections/import-custom.asc[] === 总结 From 61d2c16f6bcf841ea33c0f0ced2c83a94d8e289e Mon Sep 17 00:00:00 2001 From: hasan <1483478664@qq.com> Date: Fri, 1 Dec 2023 00:50:41 +0800 Subject: [PATCH 24/67] =?UTF-8?q?rm=20=E5=88=A0=E9=99=A4bzr=E5=92=8Ctfs=20?= =?UTF-8?q?=E5=90=8C=E5=8E=9F=E7=89=88=E4=BF=9D=E6=8C=81=E4=B8=80=E8=87=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- C-git-commands.asc | 2 +- .../sections/about-version-control.asc | 2 +- book/01-introduction/sections/what-is-git.asc | 2 +- images/git-tfs-ct.png | Bin 25154 -> 0 bytes status.json | 4 +--- 5 files changed, 4 insertions(+), 6 deletions(-) delete mode 100644 images/git-tfs-ct.png diff --git a/C-git-commands.asc b/C-git-commands.asc index 0068b8d0..84d14f55 100644 --- a/C-git-commands.asc +++ b/C-git-commands.asc @@ -568,7 +568,7 @@ Git 有一些可以与其他的版本控制系统集成的命令。 在 <> 一节中,我们解释了此命令,并探究了其他几个选项,例如 `--commit-filter`,`--subdirectory-filter` 及 `--tree-filter` 。 -在 <> 和 <> 的章节中我们使用它来修复已经导入的外部仓库。 +在 <> 的章节中我们使用它来修复已经导入的外部仓库。 === 底层命令 diff --git a/book/01-introduction/sections/about-version-control.asc b/book/01-introduction/sections/about-version-control.asc index ce9da793..83722d03 100644 --- a/book/01-introduction/sections/about-version-control.asc +++ b/book/01-introduction/sections/about-version-control.asc @@ -51,7 +51,7 @@ image::images/centralized.png[集中化的版本控制图解] (((version control,distributed))) 于是分布式版本控制系统(Distributed Version Control System,简称 DVCS)面世了。 -在这类系统中,像 Git、Mercurial、Bazaar 以及 Darcs 等,客户端并不只提取最新版本的文件快照, +在这类系统中,像 Git、Mercurial 以及 Darcs 等,客户端并不只提取最新版本的文件快照, 而是把代码仓库完整地镜像下来,包括完整的历史记录。 这么一来,任何一处协同工作用的服务器发生故障,事后都可以用任何一个镜像出来的本地仓库恢复。 因为每一次的克隆操作,实际上都是一次对代码仓库的完整备份。 diff --git a/book/01-introduction/sections/what-is-git.asc b/book/01-introduction/sections/what-is-git.asc index 268e36c1..bc6ea63e 100644 --- a/book/01-introduction/sections/what-is-git.asc +++ b/book/01-introduction/sections/what-is-git.asc @@ -9,7 +9,7 @@ ==== 直接记录快照,而非差异比较 Git 和其它版本控制系统(包括 Subversion 和近似工具)的主要差别在于 Git 对待数据的方式。 -从概念上来说,其它大部分系统以文件变更列表的方式存储信息,这类系统(CVS、Subversion、Perforce、Bazaar 等等) +从概念上来说,其它大部分系统以文件变更列表的方式存储信息,这类系统(CVS、Subversion、Perforce 等等) 将它们存储的信息看作是一组基本文件和每个文件随时间逐步累积的差异 (它们通常称作 *基于差异(delta-based)* 的版本控制)。 diff --git a/images/git-tfs-ct.png b/images/git-tfs-ct.png deleted file mode 100644 index d081f27231f9fff7284376b9229a53c037d72b9a..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 25154 zcmV)JK)b(*P)00004XF*Lt006O% z3;baP00001b5ch_0Itp)=>Px&08mU+Mey+O^Yioa^78rl`TF|${{H^>`1t?-|NHy< z@9*#N@$vru|Mm6t>FMeA_V)Dj^xfUv%gf8Xy}jb%;{E*m=H}+^?(gO0<+7?`fY7(sHmy?|NlfpM8?L(E0_OSSXw|pLI3{w*Vx(5=l{jx|N8y^ zSFZmxH8%hL^xWLsn3$OJ@$mBR@4(>yQc+U#{r~8llkPp`rxeR?(_co@Y2@TbdR{|{{Q>%-S_hE z!0-OV#KZXX=V*1T*|&_6!{$(Cd;9IsuGs#jc0@l;XmFp%UsH|!_rk#4^2ta><<-o| zpL*7;ddd3y-R=7O_V9l+Qh=PsrP2AG&g{&ni?x4j`TO*tU0BYuq^N9U_RN)#NL2Fc z;=GMt+{>kfXjjL1cXofYXnTTTI(We5mXE^_rx# zRZV&%mH%p_*R0*{yN61PxcXQ=IhnfHR&kWL+y2wv>3LOM<+pvY=lyD9f?O(9#E^BA zZgr4lK4D{?W0S_Hf?s`fX?s^i#@OdAGF$NOyl^f#G*X6cGGu5^aJA9sk5zelXqiPN zGIxHApdA3VmT)?p|Ju;LJZzey-~8n2@21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?kopbe-!($>Tpy7#$z^vURNl9_3{bcXx+HmWdumU0B&2^S<0=rzzSnp z&quaL5#<2K#cu=33NV`9OlZ!zM&|iaAt8UN1T_TY_=BMCXXWYupP1a|}v zT-B8PIE#pD>T*E0QlK9b`RC^u`b&pXM;Jg*6;Jv_@;Hb-AwKyt01jl!JAfcKpY?L1 z`Lhk^b2!*0=w=FeAf$l+Mua&HI}puZm<|d60sY|sCS+PfdDATs7jYfz7708<;YZB diff --git a/status.json b/status.json index 055b5a04..6f7ed75f 100644 --- a/status.json +++ b/status.json @@ -88,12 +88,10 @@ "sections/client-hg.asc": 100, "sections/client-p4.asc": 100, "sections/client-svn.asc": 100, - "sections/client-tfs.asc": 100, "sections/import-custom.asc": 100, "sections/import-hg.asc": 100, "sections/import-p4.asc": 100, - "sections/import-svn.asc": 100, - "sections/import-tfs.asc": 100 + "sections/import-svn.asc": 100 }, "10-git-internals": { "1-git-internals.asc": 100, From 34a517f337539567f8e1f4ce317f5f39d3f652fa Mon Sep 17 00:00:00 2001 From: hasan <1483478664@qq.com> Date: Fri, 1 Dec 2023 01:44:54 +0800 Subject: [PATCH 25/67] fix: link check --- book/06-github/sections/2-contributing.asc | 2 +- book/06-github/sections/3-maintaining.asc | 2 +- book/09-git-and-other-scms/sections/client-svn.asc | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/book/06-github/sections/2-contributing.asc b/book/06-github/sections/2-contributing.asc index 6c8c9e99..cff5f535 100644 --- a/book/06-github/sections/2-contributing.asc +++ b/book/06-github/sections/2-contributing.asc @@ -116,7 +116,7 @@ To https://github.com/tonychacon/blink 现在到 GitHub 上查看之前的项目副本,可以看到 GitHub 提示我们有新的分支, 并且显示了一个大大的绿色按钮让我们可以检查我们的改动,并给源项目创建拉取请求。 -你也可以到“Branches”(分支)页面查看分支并创建拉取请求: `https://github.com/<用户名>/<项目名>/branches` +你也可以到“Branches”(分支)页面查看分支并创建拉取请求: `\https://github.com/<用户名>/<项目名>/branches` .拉取请求按钮 image::images/blink-02-pr.png[拉取请求按钮] diff --git a/book/06-github/sections/3-maintaining.asc b/book/06-github/sections/3-maintaining.asc index 6763e80a..b1bb24c5 100644 --- a/book/06-github/sections/3-maintaining.asc +++ b/book/06-github/sections/3-maintaining.asc @@ -27,7 +27,7 @@ image::images/newrepoform.png[“new repository” 表单。] 我们不会在这里详细说明此项,如果你需要复习,去看 <>。 现在你的项目就托管在 GitHub 上了,你可以把 URL 给任何你想分享的人。 -GitHub 上的项目可通过 HTTP 或 SSH 访问,HTTPS 为 `https://github.com//` , +GitHub 上的项目可通过 HTTP 或 SSH 访问,HTTPS 为 `\https://github.com//` , SSH 为 `git@github.com:/` 。 Git 可以通过以上两种 URL 进行抓取和推送,但是用户的访问权限又因连接时使用的证书不同而异。 diff --git a/book/09-git-and-other-scms/sections/client-svn.asc b/book/09-git-and-other-scms/sections/client-svn.asc index a1b5130e..2d497f8f 100644 --- a/book/09-git-and-other-scms/sections/client-svn.asc +++ b/book/09-git-and-other-scms/sections/client-svn.asc @@ -80,7 +80,7 @@ Subversion 必须一次复制一个版本然后推送回另一个仓库——这 既然已经有了一个有写入权限的 Subversion 仓库,那么你可以开始一个典型的工作流程。 可以从 `git svn clone` 命令开始,它会将整个 Subversion 仓库导入到一个本地 Git 仓库。 -需要牢记的一点是如果是从一个真正托管的 Subversion 仓库中导入,需要将 `file:///tmp/test-svn` 替换为你的 Subversion 仓库的 URL: +需要牢记的一点是如果是从一个真正托管的 Subversion 仓库中导入,需要将 `\file:///tmp/test-svn` 替换为你的 Subversion 仓库的 URL: [source,console] ---- From 12d8485c8cafb4bad27759047ff2e22303b0a56c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jean-No=C3=ABl=20Avila?= Date: Fri, 1 Dec 2023 16:37:25 +0100 Subject: [PATCH 26/67] fix asciidoc formatting In the new asciidoc specification , the \` quoting does not escape the contained string. Thus it is critical to add the `+` around the escaped strings where needed (to escape the `*` for instance) This fixes #472 --- book/06-github/sections/2-contributing.asc | 2 +- book/10-git-internals/sections/environment.asc | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/book/06-github/sections/2-contributing.asc b/book/06-github/sections/2-contributing.asc index cff5f535..b8bf6d5d 100644 --- a/book/06-github/sections/2-contributing.asc +++ b/book/06-github/sections/2-contributing.asc @@ -303,7 +303,7 @@ Git 的伟大之处就是你可以一直重复以上操作。如果你有一个 先从如何对拉取请求或议题(Issue)进行相互引用开始。所有的拉取请求和议题在项目中都会有一个独一无二的编号。 举个例子,你无法同时拥有 3 号拉取请求和 3 号议题。如果你想要引用任何一个拉取请求或议题, -你只需要在提交或描述中输入 `#<编号>` 即可。 +你只需要在提交或描述中输入 `+#<编号>+` 即可。 你也可以指定引用其他版本库的议题或拉取请求,如果你想要引用其他人对该版本库的“Fork”中的议题或拉取请求, 输入 `用户名#<编号>` ,如果在不同的版本库中,输入 `用户名/版本库名#<编号>` 。 diff --git a/book/10-git-internals/sections/environment.asc b/book/10-git-internals/sections/environment.asc index 684ebd7f..3a22fb28 100644 --- a/book/10-git-internals/sections/environment.asc +++ b/book/10-git-internals/sections/environment.asc @@ -56,8 +56,8 @@ Git 用了几个变量来确定它如何与当前版本库交互。 它们会在 `.gitignore` 文件中用到,命令行里也会用到(`git add *.c`)。 *`GIT_GLOB_PATHSPECS`* 和 *`GIT_NOGLOB_PATHSPECS`* 控制通配符在路径规则中的默认行为。 -如果 `GIT_GLOB_PATHSPECS` 设置为 1, 通配符表现为通配符(这是默认设置); 如果 `GIT_NOGLOB_PATHSPECS` 设置为 1,通配符仅匹配字面。意思是 `*.c` 只会匹配 _文件名是_ “*.c” 的文件,而不是以 `.c` 结尾的文件。 -你可以在各个路径规范中用 `:(glob)` 或 `:(literal)` 开头来覆盖这个配置,如 `:(glob)*.c` 。 +如果 `GIT_GLOB_PATHSPECS` 设置为 1, 通配符表现为通配符(这是默认设置); 如果 `GIT_NOGLOB_PATHSPECS` 设置为 1,通配符仅匹配字面。意思是 `+*.c+` 只会匹配 _文件名是_ “*.c” 的文件,而不是以 `.c` 结尾的文件。 +你可以在各个路径规范中用 `:(glob)` 或 `:(literal)` 开头来覆盖这个配置,如 `+:(glob)*.c+` 。 *`GIT_LITERAL_PATHSPECS`* 禁用上面的两种行为;通配符将不能用,前缀覆盖也不能用。 From 5f3935992e4766d5ba25feefe87d3f6935a65f2f Mon Sep 17 00:00:00 2001 From: hasban12138 <1483478664@qq.com> Date: Sat, 2 Dec 2023 10:09:53 +0800 Subject: [PATCH 27/67] =?UTF-8?q?fix=20#issues463=208.2=E7=AB=A0=20?= =?UTF-8?q?=E8=BE=93=E5=87=BA=E4=BB=A3=E7=A0=81=E7=BF=BB=E8=AF=91=E9=94=99?= =?UTF-8?q?=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- book/08-customizing-git/sections/attributes.asc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/book/08-customizing-git/sections/attributes.asc b/book/08-customizing-git/sections/attributes.asc index c8afbb55..57f92203 100644 --- a/book/08-customizing-git/sections/attributes.asc +++ b/book/08-customizing-git/sections/attributes.asc @@ -336,9 +336,9 @@ Last commit date: Tue Apr 21 08:38:48 2009 -0700 by Scott Chacon $ echo '$Format:Last commit: %h by %aN at %cd%n%+w(76,6,9)%B$' > LAST_COMMIT $ git commit -am 'export-subst uses git log'\''s custom formatter -git archive 直接使用 git log 的 `pretty=format:` -处理器,并在输出中移除两侧的 `$Format:` 和 `$` -标记。 +git archive uses git log'\''s `pretty=format:` processor +directly, and strips the surrounding `$Format:` and `$` +markup from the output. ' $ git archive @ | tar xfO - LAST_COMMIT Last commit: 312ccc8 by Jim Hill at Fri May 8 09:14:04 2015 -0700 From 8b54c89183ba92483de1e5fccf0f7922a2021a7c Mon Sep 17 00:00:00 2001 From: hasan <1483478664@qq.com> Date: Sun, 3 Dec 2023 16:23:28 +0800 Subject: [PATCH 28/67] =?UTF-8?q?Fix:=20#issues464=203.2=E7=AB=A0=E4=B8=AD?= =?UTF-8?q?=E6=9A=82=E5=AD=98->=E8=B4=AE=E8=97=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- book/03-git-branching/sections/basic-branching-and-merging.asc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/book/03-git-branching/sections/basic-branching-and-merging.asc b/book/03-git-branching/sections/basic-branching-and-merging.asc index d360d6fc..23abd96c 100644 --- a/book/03-git-branching/sections/basic-branching-and-merging.asc +++ b/book/03-git-branching/sections/basic-branching-and-merging.asc @@ -65,7 +65,7 @@ image::images/basic-branching-3.png[`iss53` 分支随着工作的进展向前推 但是,在你这么做之前,要留意你的工作目录和暂存区里那些还没有被提交的修改, 它可能会和你即将检出的分支产生冲突从而阻止 Git 切换到该分支。 最好的方法是,在你切换分支之前,保持好一个干净的状态。 -有一些方法可以绕过这个问题(即,暂存(stashing) 和 修补提交(commit amending)), +有一些方法可以绕过这个问题(即,贮藏(stashing) 和 修补提交(commit amending)), 我们会在 <> 中看到关于这两个命令的介绍。 现在,我们假设你已经把你的修改全部提交了,这时你可以切换回 `master` 分支了: From 6fe102068ef4371a8ed2a799624547f2a516854d Mon Sep 17 00:00:00 2001 From: omvjro <144692181+omvjro@users.noreply.github.com> Date: Thu, 28 Dec 2023 22:51:01 +0800 Subject: [PATCH 29/67] Fix punctuations --- book/01-introduction/sections/first-time-setup.asc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/book/01-introduction/sections/first-time-setup.asc b/book/01-introduction/sections/first-time-setup.asc index 74e4be3d..90c76a49 100644 --- a/book/01-introduction/sections/first-time-setup.asc +++ b/book/01-introduction/sections/first-time-setup.asc @@ -14,7 +14,7 @@ Git 自带一个 `git config` 的工具来帮助设置控制 Git 外观和行为 2. `~/.gitconfig` 或 `~/.config/git/config` 文件:只针对当前用户。 你可以传递 `--global` 选项让 Git 读写此文件,这会对你系统上 **所有** 的仓库生效。 3. 当前使用仓库的 Git 目录中的 `config` 文件(即 `.git/config`):针对该仓库。 - 你可以传递 `--local` 选项让 Git 强制读写此文件,虽然默认情况下用的就是它。。 + 你可以传递 `--local` 选项让 Git 强制读写此文件,虽然默认情况下用的就是它。 (当然,你需要进入某个 Git 仓库中才能让该选项生效。) 每一个级别会覆盖上一级别的配置,所以 `.git/config` 的配置变量会覆盖 `/etc/gitconfig` 中的配置变量。 @@ -89,7 +89,7 @@ Vim、Emacs 和 Notepad++ 都是流行的文本编辑器,通常程序员们会 ==== 检查配置信息 -如果想要检查你的配置,可以使用 `git config --list` 命令来列出所有 Git 当时能找到的配置。 +如果想要检查你的配置,可以使用 `git config --list` 命令来列出所有 Git 当时能找到的配置: [source,console] ---- @@ -106,7 +106,7 @@ color.diff=auto 你可能会看到重复的变量名,因为 Git 会从不同的文件中读取同一个配置(例如:`/etc/gitconfig` 与 `~/.gitconfig`)。 这种情况下,Git 会使用它找到的每一个变量的最后一个配置。 -你可以通过输入 `git config `:(((git commands, config))) 来检查 Git 的某一项配置 +你可以通过输入 `git config `:(((git commands, config))) 来检查 Git 的某一项配置: [source,console] ---- From 26e1cd6a5061119da8da30c72eabba5938c53caa Mon Sep 17 00:00:00 2001 From: omvjro <144692181+omvjro@users.noreply.github.com> Date: Thu, 28 Dec 2023 22:53:32 +0800 Subject: [PATCH 30/67] Fix punctuation MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 重复逗号 --- book/05-distributed-git/sections/contributing.asc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/book/05-distributed-git/sections/contributing.asc b/book/05-distributed-git/sections/contributing.asc index ed611036..981d88cb 100644 --- a/book/05-distributed-git/sections/contributing.asc +++ b/book/05-distributed-git/sections/contributing.asc @@ -422,7 +422,7 @@ Merge made by the 'recursive' strategy. 1 files changed, 4 insertions(+), 0 deletions(-) ---- -此时,Jessica 想要将所有合并后的“featureB”推送回服务器,,但她并不想直接推送她自己的 `featureB` 分支。 +此时,Jessica 想要将所有合并后的“featureB”推送回服务器,但她并不想直接推送她自己的 `featureB` 分支。 由于 Josie 已经开启了一个上游的 `featureBee` 分支,因此 Jessica 想要推送到 *这个* 分支上,于是她这样做: [source,console] From a7baa05fc387333be21e3fe014d85a50b147e237 Mon Sep 17 00:00:00 2001 From: omvjro <144692181+omvjro@users.noreply.github.com> Date: Thu, 28 Dec 2023 15:18:46 +0000 Subject: [PATCH 31/67] Fix typo and improve translation --- C-git-commands.asc | 8 ++++---- .../sections/basic-branching-and-merging.asc | 2 +- book/06-github/sections/2-contributing.asc | 6 +++--- book/07-git-tools/sections/reset.asc | 2 +- book/10-git-internals/sections/maintenance.asc | 2 +- 5 files changed, 10 insertions(+), 10 deletions(-) diff --git a/C-git-commands.asc b/C-git-commands.asc index 84d14f55..88d6a418 100644 --- a/C-git-commands.asc +++ b/C-git-commands.asc @@ -2,11 +2,11 @@ [appendix] == Git 命令 -在这一整本书里我们介绍了大量的 Git 命令,并尽可能的通过讲故事的的方式来介绍它们,慢慢的介绍了越来越多的命令。 -但是这导致这些命令的示例用法都散落在在全书的各处。 +在这一整本书里我们介绍了大量的 Git 命令,并尽可能通过讲故事的方式来介绍它们,慢慢介绍了越来越多的命令。 +但是这导致这些命令的示例用法都散落在全书的各处。 -在此附录中,我们会将本书中所提到过的命令都过一遍,并根据其用途大致的分类。 -我们会大致地讨论每个命的作用,指出其在本书中哪些章节使用过。 +在此附录中,我们会将本书中所提到过的命令都过一遍,并根据其用途进行大致分类。 +我们会大致地讨论每个命令的作用,指出其在本书中哪些章节使用过。 [TIP] ==== diff --git a/book/03-git-branching/sections/basic-branching-and-merging.asc b/book/03-git-branching/sections/basic-branching-and-merging.asc index 23abd96c..b77cd923 100644 --- a/book/03-git-branching/sections/basic-branching-and-merging.asc +++ b/book/03-git-branching/sections/basic-branching-and-merging.asc @@ -297,7 +297,7 @@ Changes to be committed: modified: index.html ---- -如果你对结果感到满意,并且确定之前有冲突的的文件都已经暂存了,这时你可以输入 `git commit` 来完成合并提交。 +如果你对结果感到满意,并且确定之前有冲突的文件都已经暂存了,这时你可以输入 `git commit` 来完成合并提交。 默认情况下提交信息看起来像下面这个样子: [source,console] diff --git a/book/06-github/sections/2-contributing.asc b/book/06-github/sections/2-contributing.asc index b8bf6d5d..78b17e27 100644 --- a/book/06-github/sections/2-contributing.asc +++ b/book/06-github/sections/2-contributing.asc @@ -56,7 +56,7 @@ Tony 在找一些能在他的 Arduino 微控制器上运行的代码,他觉得 .他想要做出贡献的项目 image::images/blink-01-start.png[他想要做出贡献的项目] -但是有个问题,这个代码中的的闪烁频率太高,我们觉得 3 秒一次比 1 秒一次更好一些。 +但是有个问题,这个代码中的闪烁频率太高,我们觉得 3 秒一次比 1 秒一次更好一些。 所以让我们来改进这个程序,并将修改后的代码提交给这个项目。 首先,单击“Fork”按钮来获得这个项目的副本。 @@ -207,8 +207,8 @@ image::images/blink-06-final.png[最终的拉取请求] ===== 将拉取请求制作成补丁 -有一件重要的事情:许多项目并不认为拉取请求可以作为补丁, -就和通过邮件列表工作的的项目对补丁贡献的看法一样。 +有一件重要的事情:和大部分通过邮件列表工作的项目对补丁贡献的看法一样, +许多项目并不认为拉取请求可以作为补丁。 大多数的 GitHub 项目将拉取请求的分支当作对改动的交流方式,并将变更集合起来统一进行合并。 这是个重要的差异,因为一般来说改动会在代码完成前提出,这和基于邮件列表的补丁贡献有着天差地别。 diff --git a/book/07-git-tools/sections/reset.asc b/book/07-git-tools/sections/reset.asc index c84120ae..42f963ca 100644 --- a/book/07-git-tools/sections/reset.asc +++ b/book/07-git-tools/sections/reset.asc @@ -184,7 +184,7 @@ image::images/reset-mixed.png[] ===== 第 3 步:更新工作目录(--hard) -`reset` 要做的的第三件事情就是让工作目录看起来像索引。 +`reset` 要做的第三件事情就是让工作目录看起来像索引。 如果使用 `--hard` 选项,它将会继续这一步。 image::images/reset-hard.png[] diff --git a/book/10-git-internals/sections/maintenance.asc b/book/10-git-internals/sections/maintenance.asc index 2a7b2589..27c72691 100644 --- a/book/10-git-internals/sections/maintenance.asc +++ b/book/10-git-internals/sections/maintenance.asc @@ -300,7 +300,7 @@ Rewrite dadf7258d699da2c8d89b09ef6670edb7d5f91b4 (2/2) Ref 'refs/heads/master' was rewritten ---- -`--index-filter` 选项类似于在 <> 中提到的的 `--tree-filter` 选项, +`--index-filter` 选项类似于在 <> 中提到的 `--tree-filter` 选项, 不过这个选项并不会让命令将修改在硬盘上检出的文件,而只是修改在暂存区或索引中的文件。 你必须使用 `git rm --cached` 命令来移除文件,而不是通过类似 `rm file` 的命令——因为你需要从索引中移除它,而不是磁盘中。 From 3d440f606911fd38ea310efc84860660371eb34f Mon Sep 17 00:00:00 2001 From: moralok Date: Tue, 20 Feb 2024 20:15:39 +0800 Subject: [PATCH 32/67] Fix typo for protocols.asc MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit update "即支持...也" to "既支持...也" update "登录的用" to "登录的用户" --- book/04-git-server/sections/protocols.asc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/book/04-git-server/sections/protocols.asc b/book/04-git-server/sections/protocols.asc index f4b396b1..56eb42c8 100644 --- a/book/04-git-server/sections/protocols.asc +++ b/book/04-git-server/sections/protocols.asc @@ -81,7 +81,7 @@ Git 1.6.6 版本引入了一种新的、更智能的协议,让 Git 可以像 智能 HTTP 的运行方式和 SSH 及 Git 协议类似,只是运行在标准的 HTTP/S 端口上并且可以使用各种 HTTP 验证机制, 这意味着使用起来会比 SSH 协议简单的多,比如可以使用 HTTP 协议的用户名/密码授权,免去设置 SSH 公钥。 -智能 HTTP 协议或许已经是最流行的使用 Git 的方式了,它即支持像 `git://` 协议一样设置匿名服务, +智能 HTTP 协议或许已经是最流行的使用 Git 的方式了,它既支持像 `git://` 协议一样设置匿名服务, 也可以像 SSH 协议一样提供传输时的授权和加密。 而且只用一个 URL 就可以都做到,省去了为不同的需求设置不同的 URL。 如果你要推送到一个需要授权的服务器上(一般来讲都需要),服务器会提示你输入用户名和密码。 @@ -169,7 +169,7 @@ $ git clone ssh://[user@]server/project.git $ git clone [user@]server:project.git ---- -在上面两种情况中,如果你不指定可选的用户名,那么 Git 会使用当前登录的用的名字。 +在上面两种情况中,如果你不指定可选的用户名,那么 Git 会使用当前登录的用户的名字。 ===== 优势 From c2edbb7077d15d9721a4f990d4e3b3eb8db31a5f Mon Sep 17 00:00:00 2001 From: zyw_0618 Date: Thu, 8 Feb 2024 10:46:39 +0800 Subject: [PATCH 33/67] Fix quotation marks --- book/03-git-branching/sections/remote-branches.asc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/book/03-git-branching/sections/remote-branches.asc b/book/03-git-branching/sections/remote-branches.asc index b0475b9a..25a88756 100644 --- a/book/03-git-branching/sections/remote-branches.asc +++ b/book/03-git-branching/sections/remote-branches.asc @@ -42,7 +42,7 @@ image::images/remote-branches-1.png[克隆之后的服务器与本地仓库。] image::images/remote-branches-2.png[本地与远程的工作可以分叉。] 如果要与给定的远程仓库同步数据,运行 `git fetch ` 命令(在本例中为 `git fetch origin`)。 -这个命令查找 ``origin'' 是哪一个服务器(在本例中,它是 `git.ourcompany.com`), +这个命令查找 “origin” 是哪一个服务器(在本例中,它是 `git.ourcompany.com`), 从中抓取本地没有的数据,并且更新本地数据库,移动 `origin/master` 指针到更新之后的位置。 .`git fetch` 更新你的远程跟踪分支 From 9e5df4369de3710dc368471b02dec9c7b453981a Mon Sep 17 00:00:00 2001 From: zyw_0618 Date: Sat, 2 Mar 2024 09:10:29 +0800 Subject: [PATCH 34/67] Fix escape character and figure title --- book/07-git-tools/sections/revision-selection.asc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/book/07-git-tools/sections/revision-selection.asc b/book/07-git-tools/sections/revision-selection.asc index b9b310a3..7157fdc4 100644 --- a/book/07-git-tools/sections/revision-selection.asc +++ b/book/07-git-tools/sections/revision-selection.asc @@ -276,7 +276,7 @@ Date: Fri Nov 7 13:47:59 2008 -0500 ignore *.gem ---- -也可以写成 `HEAD~~~`,也是第一父提交的第一父提交的第一父提交: +也可以写成 `HEAD\~~~`,也是第一父提交的第一父提交的第一父提交: [source,console] ---- @@ -301,10 +301,10 @@ Date: Fri Nov 7 13:47:59 2008 -0500 最常用的指明提交区间语法是双点。 这种语法可以让 Git 选出在一个分支中而不在另一个分支中的提交。 -例如,你有如下的提交历史 <> +例如,假设你的提交历史类似于 <>。 [[double_dot]] -.Example history for range selection. +.区间选择的提交历史示例 image::images/double-dot.png[区间选择的提交历史示例] 你想要查看 experiment 分支中还有哪些提交尚未被合并入 master 分支。 From 92830bbb7db80af88a7d533b273e28b2a7ec242a Mon Sep 17 00:00:00 2001 From: Alpha Hinex Date: Sat, 13 Jul 2024 16:21:52 +0800 Subject: [PATCH 35/67] Update refspec.asc --- book/10-git-internals/sections/refspec.asc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/book/10-git-internals/sections/refspec.asc b/book/10-git-internals/sections/refspec.asc index 996361a8..a1964d9c 100644 --- a/book/10-git-internals/sections/refspec.asc +++ b/book/10-git-internals/sections/refspec.asc @@ -80,14 +80,14 @@ From git@github.com:schacon/simplegit fetch = +refs/heads/experiment:refs/remotes/origin/experiment ---- -我们不能在模式中使用部分通配符,所以像下面这样的引用规范是不合法的: +自 Git 2.6.0 起可以在模式中使用部分通配符以匹配多个分支,所以这样是可以工作的: [source,ini] ---- fetch = +refs/heads/qa*:refs/remotes/origin/qa* ---- -但我们可以使用命名空间(或目录)来达到类似目的。 +更棒的是,我们可以使用命名空间(或目录)来实现相同的目标,并且更具结构性。 假设你有一个 QA 团队,他们推送了一系列分支,同时你只想要获取 `master` 和 QA 团队的所有分支而不关心其他任何分支,那么可以使用如下配置: From df02cfe35a2fc08c4caa9a7f96d0d82f799adecd Mon Sep 17 00:00:00 2001 From: Yuhang Guo <22561797+Sherry520@users.noreply.github.com> Date: Wed, 31 Jul 2024 16:04:10 +0800 Subject: [PATCH 36/67] fix issue484 --- book/07-git-tools/sections/reset.asc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/book/07-git-tools/sections/reset.asc b/book/07-git-tools/sections/reset.asc index 42f963ca..944fbfbf 100644 --- a/book/07-git-tools/sections/reset.asc +++ b/book/07-git-tools/sections/reset.asc @@ -179,7 +179,7 @@ image::images/reset-mixed.png[] 如果指定 `--mixed` 选项,`reset` 将会在这时停止。 这也是默认行为,所以如果没有指定任何选项(在本例中只是 `git reset HEAD~`),这就是命令将会停止的地方。 -现在再看一眼上图,理解一下发生的事情:它依然会撤销一上次 `提交`,但还会 _取消暂存_ 所有的东西。 +现在再看一眼上图,理解一下发生的事情:它依然会撤销上一次 `提交`,但还会 _取消暂存_ 所有的东西。 于是,我们回滚到了所有 `git add` 和 `git commit` 的命令执行之前。 ===== 第 3 步:更新工作目录(--hard) From 2149fdac7320bd3ca432bcd5652bc09283f4a39a Mon Sep 17 00:00:00 2001 From: Yuhang Guo <22561797+Sherry520@users.noreply.github.com> Date: Thu, 1 Aug 2024 17:06:49 +0800 Subject: [PATCH 37/67] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E8=8B=B1=E6=96=87?= =?UTF-8?q?=E5=8F=A5=E5=8F=B7=E4=B8=BA=E4=B8=AD=E6=96=87=E5=8F=A5=E5=8F=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- book/07-git-tools/sections/subtree-merges.asc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/book/07-git-tools/sections/subtree-merges.asc b/book/07-git-tools/sections/subtree-merges.asc index b3154b95..5e5f2166 100644 --- a/book/07-git-tools/sections/subtree-merges.asc +++ b/book/07-git-tools/sections/subtree-merges.asc @@ -44,7 +44,7 @@ README ---- 这个是一个比较奇怪的概念。 -并不是仓库中的所有分支都是必须属于同一个项目的分支. +并不是仓库中的所有分支都是必须属于同一个项目的分支。 这并不常见,因为没啥用,但是却是在不同分支里包含两条完全不同提交历史的最简单的方法。 在这个例子中,我们希望将 Rack 项目拉到 `master` 项目中作为一个子目录。 From 21dea4776146ded06a0df4fc07840e2443fab63a Mon Sep 17 00:00:00 2001 From: Yuhang Guo <22561797+Sherry520@users.noreply.github.com> Date: Fri, 9 Aug 2024 11:40:19 +0800 Subject: [PATCH 38/67] =?UTF-8?q?=E6=9B=B4=E6=AD=A3=20curl=20=E5=91=BD?= =?UTF-8?q?=E4=BB=A4=E5=8F=82=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- book/10-git-internals/sections/maintenance.asc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/book/10-git-internals/sections/maintenance.asc b/book/10-git-internals/sections/maintenance.asc index 27c72691..472da33f 100644 --- a/book/10-git-internals/sections/maintenance.asc +++ b/book/10-git-internals/sections/maintenance.asc @@ -197,7 +197,7 @@ Git 有很多很棒的功能,但是其中一个特性会导致问题,`git cl [source,console] ---- -$ curl https://www.kernel.org/pub/software/scm/git/git-2.1.0.tar.gz > git.tgz +$ curl -L https://www.kernel.org/pub/software/scm/git/git-2.1.0.tar.gz > git.tgz $ git add git.tgz $ git commit -m 'add git tarball' [master 7b30847] add git tarball From fcffa56a989b9264e7acbf32522801f45fe75a47 Mon Sep 17 00:00:00 2001 From: Yuhang Guo <22561797+Sherry520@users.noreply.github.com> Date: Mon, 12 Aug 2024 19:55:07 +0800 Subject: [PATCH 39/67] =?UTF-8?q?=E6=9B=B4=E6=AD=A3=E8=BE=85=E5=8A=A9?= =?UTF-8?q?=E5=B7=A5=E5=85=B7git-credential-read-only=E7=9A=84=E8=BE=93?= =?UTF-8?q?=E5=85=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- book/07-git-tools/sections/credentials.asc | 1 + 1 file changed, 1 insertion(+) diff --git a/book/07-git-tools/sections/credentials.asc b/book/07-git-tools/sections/credentials.asc index eeb36413..1d5be269 100644 --- a/book/07-git-tools/sections/credentials.asc +++ b/book/07-git-tools/sections/credentials.asc @@ -187,6 +187,7 @@ include::../git-credential-read-only[] $ git credential-read-only --file=/mnt/shared/creds get protocol=https host=mygithost +username=bob protocol=https host=mygithost From 66c8cea656b8e18dac55d8f1907336c870687449 Mon Sep 17 00:00:00 2001 From: Yuhang Guo <22561797+Sherry520@users.noreply.github.com> Date: Mon, 12 Aug 2024 19:44:34 +0800 Subject: [PATCH 40/67] =?UTF-8?q?=E7=BF=BB=E8=AF=91=E9=99=84=E5=BD=95B-Dul?= =?UTF-8?q?wich?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- book/B-embedding-git/sections/dulwich.asc | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/book/B-embedding-git/sections/dulwich.asc b/book/B-embedding-git/sections/dulwich.asc index 9a238699..ca0754dd 100644 --- a/book/B-embedding-git/sections/dulwich.asc +++ b/book/B-embedding-git/sections/dulwich.asc @@ -1,14 +1,14 @@ === Dulwich (((Dulwich)))(((Python))) -There is also a pure-Python Git implementation - Dulwich. -The project is hosted under https://www.dulwich.io/ -It aims to provide an interface to git repositories (both local and remote) that doesn't call out to git directly but instead uses pure Python. -It has an optional C extensions though, that significantly improve the performance. +这还有一个纯-Python 的 Git 实现——Dulwich。 +该项目托管在 https://www.dulwich.io/[]。 +它旨在在提供一个与 Git 存储库(本地和远程)的接口,该接口不直接调用 git,而是使用纯 Python。 +它有一个可选的 C 扩展,可以显著提高性能。 -Dulwich follows git design and separate two basic levels of API: plumbing and porcelain. +Dulwich 遵循 git 设计,将 API 分为两个基本级别:底层命令和上层命令。 -Here is an example of using the lower level API to access the commit message of the last commit: +下面是一个使用低级 API 获取上次提交的提交消息的例子: [source, python] ---- @@ -25,7 +25,7 @@ c.message # 'Add note about encoding.\n' ---- -To print a commit log using high-level porcelain API, one can use: +要使用高级上层命令 API 打印提交日志,可以使用: [source, python] ---- @@ -38,6 +38,6 @@ porcelain.log('.', max_entries=1) ---- -==== Further Reading +==== 拓展阅读 -The API documentation, tutorial, and many examples of how to do specific tasks with Dulwich are available on the official website https://www.dulwich.io[]. +在官方网站 https://www.dulwich.io[] 上可以找到 API 文档、教程和许多关于如何使用 Dulwich 完成特定任务的示例。 From 0a750c183bb65e29c0e20827c8aff7b70cefed3e Mon Sep 17 00:00:00 2001 From: Yuhang Guo <22561797+Sherry520@users.noreply.github.com> Date: Mon, 12 Aug 2024 20:24:19 +0800 Subject: [PATCH 41/67] =?UTF-8?q?=E4=BF=AE=E6=94=B9painful=E7=9A=84?= =?UTF-8?q?=E7=BF=BB=E8=AF=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- book/B-embedding-git/sections/libgit2.asc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/book/B-embedding-git/sections/libgit2.asc b/book/B-embedding-git/sections/libgit2.asc index 59e09081..7cfc76d0 100644 --- a/book/B-embedding-git/sections/libgit2.asc +++ b/book/B-embedding-git/sections/libgit2.asc @@ -49,7 +49,7 @@ git_repository_free(repo); 值 `0` 表示成功,比它小的则是一个错误。 * 如果 Libgit2 为你填入一个指针,那么你有责任释放它。 * 如果 Libgit2 在一个调用中返回一个 `const` 指针,你不需要释放它,但是当它所指向的对象被释放时它将不可用。 -* 用 C 来写有点蛋疼。 +* 用 C 来写有点痛苦。 (((Ruby))) 最后一点意味着你应该不会在使用 Libgit2 时编写 C 语言程序。 From 0393b5251349215a54594304c639824b5911b16c Mon Sep 17 00:00:00 2001 From: Yuhang Guo <22561797+Sherry520@users.noreply.github.com> Date: Tue, 13 Aug 2024 10:44:53 +0800 Subject: [PATCH 42/67] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E9=99=84=E5=BD=95A?= =?UTF-8?q?=EF=BC=9AGit=20in=20bash=E7=BC=BA=E5=B0=91=E7=9A=84=E7=BF=BB?= =?UTF-8?q?=E8=AF=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- book/A-git-in-other-environments/sections/bash.asc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/book/A-git-in-other-environments/sections/bash.asc b/book/A-git-in-other-environments/sections/bash.asc index 1bcecfb3..49ee281c 100644 --- a/book/A-git-in-other-environments/sections/bash.asc +++ b/book/A-git-in-other-environments/sections/bash.asc @@ -4,8 +4,9 @@ 如果你是一名 Bash 用户,你可以从中发掘出一些 Shell 的特性,让你在使用 Git 时更加随心所欲。 实际上 Git 附带了几个 Shell 的插件,但是这些插件并不是默认打开的。 -首先,你需要从 Git 源代码中获得一份 `contrib/completion/git-completion.bash` 文件的拷贝。 -将这个文件复制到一个相对便捷的目录,例如你的 Home 目录,并且将它的路径添加到 `.bashrc` 中: +首先,你需要从你使用的 Git 发行版的源代码中获得一份自动补全文件的拷贝。 +输入 `git version` 检查版本,然后使用 `git checkout tags/vX.Y.Z`,其中 `vX.Y.Z` 对应于你正在使用的 Git 版本。 +将这个 `contrib/completion/git-completion.bash` 文件复制到一个相对便捷的目录,例如你的 Home 目录,并且将它的路径添加到 `.bashrc` 中: [source,console] ----- From 1b8b81f1d57315921df22b5fa894b846daed42a9 Mon Sep 17 00:00:00 2001 From: Yuhang Guo <22561797+Sherry520@users.noreply.github.com> Date: Tue, 13 Aug 2024 11:05:04 +0800 Subject: [PATCH 43/67] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E9=99=84=E5=BD=95A?= =?UTF-8?q?=EF=BC=9Azsh=E6=9C=AA=E9=81=B5=E5=BE=AA=E5=8E=9F=E6=96=87?= =?UTF-8?q?=E6=AE=B5=E8=90=BD=E6=A0=BC=E5=BC=8F=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- book/A-git-in-other-environments/sections/zsh.asc | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/book/A-git-in-other-environments/sections/zsh.asc b/book/A-git-in-other-environments/sections/zsh.asc index 9a25610d..9ae7165e 100644 --- a/book/A-git-in-other-environments/sections/zsh.asc +++ b/book/A-git-in-other-environments/sections/zsh.asc @@ -34,17 +34,15 @@ zstyle ':vcs_info:git:*' formats '%b' ---- 当你的命令行位于一个 Git 仓库目录时,在任何时候,都可以在命令行窗口右侧显示当前分支。 -(当然也可以在左侧显示,只需把上面 PROMPT 的注释去掉即可。) +(当然也可以在左侧显示,只需把上面 `PROMPT` 的注释去掉即可。) 它看起来像这样: .自定义 `zsh` 提示符. image::images/zsh-prompt.png[自定义 `zsh` 提示符.] -关于 vcs_info 的更多信息,可参见 `zshcontrib(1)` 手册页面中对应的文档,或访问 -http://zsh.sourceforge.net/Doc/Release/User-Contributions.html#Version-Control-Information[] 在线浏览。 +关于 `vcs_info` 的更多信息,可参见 `zshcontrib(1)` 手册页面中对应的文档,或访问 http://zsh.sourceforge.net/Doc/Release/User-Contributions.html#Version-Control-Information[] 在线浏览。 -比起 vcs_info 而言,你可能更偏好提供了 Git 的命令提示符定制脚本 `git-prompt.sh` 。 -更多信息见 https://github.com/git/git/blob/master/contrib/completion/git-prompt.sh[] 。 +比起 `vcs_info` 而言,你可能更偏好提供了 Git 的命令提示符定制脚本 `git-prompt.sh`;更多信息见 https://github.com/git/git/blob/master/contrib/completion/git-prompt.sh[]。 `git-prompt.sh` 同时兼容 Bash 和 Zsh。 Zsh 本身已足够强大,但还有一些专门为它打造的完整框架,使它更加完善。 @@ -54,4 +52,4 @@ oh-my-zsh 的扩展系统包含强大的 Git Tab 补全功能,且许多提示 [[oh_my_zsh_git]] .一个 oh-my-zsh 主题的示例. -image::images/zsh-oh-my.png[一个 oh-my-zsh 主题的示例.] +image::images/zsh-oh-my.png[一个 oh-my-zsh 主题的示例] From 3065c7e1e83c02853e1619135029a70b1a1aa550 Mon Sep 17 00:00:00 2001 From: Yuhang Guo <22561797+Sherry520@users.noreply.github.com> Date: Tue, 13 Aug 2024 10:58:48 +0800 Subject: [PATCH 44/67] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E9=99=84=E5=BD=95A?= =?UTF-8?q?=EF=BC=9Asublimetext=E6=9C=AA=E9=81=B5=E5=BE=AA=E5=8E=9F?= =?UTF-8?q?=E6=96=87=E6=AE=B5=E8=90=BD=E6=A0=BC=E5=BC=8F=E7=9A=84=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../A-git-in-other-environments/sections/sublimetext.asc | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/book/A-git-in-other-environments/sections/sublimetext.asc b/book/A-git-in-other-environments/sections/sublimetext.asc index 51d4c816..7013ed4c 100644 --- a/book/A-git-in-other-environments/sections/sublimetext.asc +++ b/book/A-git-in-other-environments/sections/sublimetext.asc @@ -9,9 +9,8 @@ * 被你的 .gitignore 文件所指定忽略的文件以及文件夹会在侧边栏褪色显示。 * 在状态栏,你能够查看当前所在分支以及你做了多少修改。 * 对一个文件的所有改动都会通过行号槽上的记号显示出来。 -* 你能够在 Sublime Text 内使用 Sublime Merge 这个 Git 客户端的部分功能。(要求安装 Sublime Merge: -https://www.sublimemerge.com/ ) +* 你能够在 Sublime Text 内使用 Sublime Merge 这个 Git 客户端的部分功能。 + 要求安装 Sublime Merge: + https://www.sublimemerge.com/。 - -Sublime Text 的官方文档请访问: -https://www.sublimetext.com/docs/3/git_integration.html 。 +Sublime Text 的官方文档请访问:https://www.sublimetext.com/docs/3/git_integration.html。 From c9b2ebeb078c06719441329df1d7fdd5d19034a4 Mon Sep 17 00:00:00 2001 From: Yuhang Guo <22561797+Sherry520@users.noreply.github.com> Date: Tue, 13 Aug 2024 11:27:21 +0800 Subject: [PATCH 45/67] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E9=99=84=E5=BD=95A?= =?UTF-8?q?=EF=BC=9Avisualstudiocode=E6=9C=AA=E9=81=B5=E5=BE=AA=E5=8E=9F?= =?UTF-8?q?=E6=96=87=E6=AE=B5=E8=90=BD=E6=A0=BC=E5=BC=8F=E5=92=8C=E7=BF=BB?= =?UTF-8?q?=E8=AF=91=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../sections/visualstudiocode.asc | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/book/A-git-in-other-environments/sections/visualstudiocode.asc b/book/A-git-in-other-environments/sections/visualstudiocode.asc index 99e8ac6e..4367b56e 100644 --- a/book/A-git-in-other-environments/sections/visualstudiocode.asc +++ b/book/A-git-in-other-environments/sections/visualstudiocode.asc @@ -1,7 +1,8 @@ === Visual Studio Code 中的 Git (((Visual Studio Code))) -Visual Studio Code 自带对 Git 的支持。你需要已经安装好 2.0.0(及以上)版本的 Git。 +Visual Studio Code 自带对 Git 的支持。 +你需要安装 2.0.0(及以上)版本的 Git。 主要功能如下: @@ -16,7 +17,6 @@ Visual Studio Code 自带对 Git 的支持。你需要已经安装好 2.0.0( ** 解决合并冲突。 ** 查看比较。 * 配合一个扩展,你也能够处理 GitHub 的拉取请求: - https://marketplace.visualstudio.com/items?itemName=GitHub.vscode-pull-request-github + https://marketplace.visualstudio.com/items?itemName=GitHub.vscode-pull-request-github。 -官方文档请访问: -https://code.visualstudio.com/Docs/editor/versioncontrol \ No newline at end of file +官方文档请访问: https://code.visualstudio.com/Docs/editor/versioncontrol。 From 3d6774778a945b2c921b648f95008bdbc6f4561b Mon Sep 17 00:00:00 2001 From: Yuhang Guo <22561797+Sherry520@users.noreply.github.com> Date: Tue, 13 Aug 2024 11:00:54 +0800 Subject: [PATCH 46/67] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E9=99=84=E5=BD=95A?= =?UTF-8?q?=EF=BC=9Avisualstudio=E6=9C=AA=E9=81=B5=E5=BE=AA=E5=8E=9F?= =?UTF-8?q?=E6=96=87=E6=AE=B5=E8=90=BD=20=E5=A4=9A=E5=87=BA=E7=A9=BA?= =?UTF-8?q?=E8=A1=8C=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- book/A-git-in-other-environments/sections/visualstudio.asc | 1 - 1 file changed, 1 deletion(-) diff --git a/book/A-git-in-other-environments/sections/visualstudio.asc b/book/A-git-in-other-environments/sections/visualstudio.asc index bbac5006..39c47012 100644 --- a/book/A-git-in-other-environments/sections/visualstudio.asc +++ b/book/A-git-in-other-environments/sections/visualstudio.asc @@ -16,4 +16,3 @@ * ... 等等。 阅读 https://docs.microsoft.com/visualstudio/version-control[official documentation^] 以了解更多内容。 - From eb3ff52fda1ef752e21c45df33765b47807169ea Mon Sep 17 00:00:00 2001 From: Yuhang Guo <22561797+Sherry520@users.noreply.github.com> Date: Tue, 13 Aug 2024 10:56:56 +0800 Subject: [PATCH 47/67] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E9=99=84=E5=BD=95A?= =?UTF-8?q?=EF=BC=9Apowershell=E6=9C=AA=E9=81=B5=E5=BE=AA=E5=8E=9F?= =?UTF-8?q?=E6=96=87=E6=AE=B5=E8=90=BD=E6=A0=BC=E5=BC=8F=E5=92=8C=E7=BF=BB?= =?UTF-8?q?=E8=AF=91=E7=BA=A6=E5=AE=9A=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../sections/powershell.asc | 54 +++++++++++-------- 1 file changed, 33 insertions(+), 21 deletions(-) diff --git a/book/A-git-in-other-environments/sections/powershell.asc b/book/A-git-in-other-environments/sections/powershell.asc index 278a1f78..97a52870 100644 --- a/book/A-git-in-other-environments/sections/powershell.asc +++ b/book/A-git-in-other-environments/sections/powershell.asc @@ -5,55 +5,64 @@ (((posh-git))) Windows 中早期的命令行终端 `cmd.exe` 无法自定义 Git 使用体验,但是如果你正在使用 Powershell,那么你就十分幸运了。 这种方法同样适用于 Linux 或 macOS 上运行的 PowerShell Core。 -一个名为 Posh-Git (https://github.com/dahlbyk/posh-git[]) 的扩展包提供了强大的 tab 补全功能, 并针对提示符进行了增强,以帮助你聚焦于你的仓库状态。 +一个名为 posh-git (https://github.com/dahlbyk/posh-git[]) 的扩展包提供了强大的 tab 补全功能,并针对提示符进行了增强,以帮助你聚焦于你的仓库状态。 它看起来像: -.附带了 Posh-Git 扩展包的 Powershell。 -image::images/posh-git.png[附带了 Posh-Git 扩展包的 Powershell] +.附带了 posh-git 扩展包的 Powershell。 +image::images/posh-git.png[附带了 posh-git 扩展包的 Powershell] ==== 安装 + ===== 前提需求(仅限 Windows) -在可以运行 PowerShell 脚本之前,你需要将本地的 ExecutionPolicy 设置为 RemoteSigned -(可以说是允许除了 Undefined 和 Restricted 之外的任何内容)。如果你选择了 AllSigned -而非 RemoteSigned,那么你的本地脚本还需要数字签名后才能执行。如果设置为 RemoteSigned, -那么只有“ZoneIdentifier”设置为 Internet,即从 Web 上下载的脚本才需要签名,其它则不需要。 -如果你是管理员,想要为本机上的所有用户设置它,请使用“-Scope LocalMachine”。 -如果你是没有管理权限的普通用户,可使用“-Scope CurrentUser”来只为自己设置它。 + +在可以运行 PowerShell 脚本之前,你需要将本地的 `ExecutionPolicy` 设置为 `RemoteSigned`(可以说是允许除了 `Undefined` 和 `Restricted` 之外的任何内容)。 +如果你选择了 `AllSigned` 而非 `RemoteSigned`,那么你的本地脚本还需要数字签名后才能执行。 +如果设置为 `RemoteSigned`,那么只有 `ZoneIdentifier` 设置为 `Internet`,即从 Web 上下载的脚本才需要签名,其它则不需要。 +如果你是管理员,想要为本机上的所有用户设置它,请使用 `-Scope LocalMachine`。 +如果你是没有管理权限的普通用户,可使用 `-Scope CurrentUser` 来只为自己设置它。 有关 PowerShell Scopes 的更多详情: https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_scopes[] 有关 PowerShell ExecutionPolicy 的更多详情: https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.security/set-executionpolicy[] +对于所有用户使用以下命令来设置 `ExecutionPolicy` 为 `RemoteSigned`: + [source,powershell] ----- > Set-ExecutionPolicy -Scope LocalMachine -ExecutionPolicy RemoteSigned -Force ----- ===== PowerShell Gallery + 如果你有 PowerShell 5 以上或安装了 PackageManagement 的 PowerShell 4,那么可以用包管理器来安装 posh-git。 有关 PowerShell Gallery 的更多详情: https://docs.microsoft.com/en-us/powershell/scripting/gallery/overview[] + [source,powershell] ----- > Install-Module posh-git -Scope CurrentUser -Force > Install-Module posh-git -Scope CurrentUser -AllowPrerelease -Force # 带有 PowerShell Core 支持的更新的 beta 版 ----- -如果你想为所有的用户安装 posh-git,请使用“-Scope AllUsers”并在管理员权限启动的 PowerShell 控制台中执行。 -如果第二条命令执行失败并出现类似 `Module 'PowerShellGet' was not installed by using Install-Module` 这样的错误, -那么你需要先运行另一条命令: + +如果你想为所有的用户安装 posh-git,请使用 `-Scope AllUsers` 并在管理员权限启动的 PowerShell 控制台中执行。 +如果第二条命令执行失败并出现类似 `Module 'PowerShellGet' was not installed by using Install-Module` 这样的错误,那么你需要先运行另一条命令: [source,powershell] ---- > Install-Module PowerShellGet -Force -SkipPublisherCheck ---- -之后你可以再试一遍。出现这个错误的原因是 Windows PowerShell 搭载的模块是以不同的发布证书签名的。 +之后你可以再试一遍。 +出现这个错误的原因是 Windows PowerShell 搭载的模块是以不同的发布证书签名的。 ===== 更新 PowerShell 提示符 -要在你的提示符中包含 Git 信息,那么需要导入 Posh-Git 模块。 -要让 PowerShell 在每次启动时都导入 Posh-Git,请执行 Add-PoshGitToProfile 命令, -它会在你的 $profile 脚本中添加导入语句。此脚本会在每次打开新的 PowerShell 终端时执行。 -注意,存在多个 $profile 脚本。例如,其中一个是控制台的,另一个则属于 ISE。 + +要在你的提示符中包含 Git 信息,那么需要导入 posh-git 模块。 +要让 PowerShell 在每次启动时都导入 posh-git,请执行 `Add-PoshGitToProfile` 命令,它会在你的 `$profile` 脚本中添加导入语句。 +此脚本会在每次打开新的 PowerShell 终端时执行。 +注意,存在多个 `$profile` 脚本。 +例如,其中一个是控制台的,另一个则属于 ISE。 + [source,powershell] ----- > Import-Module posh-git @@ -61,14 +70,17 @@ image::images/posh-git.png[附带了 Posh-Git 扩展包的 Powershell] ----- ===== 从源码安装 -只需从 (https://github.com/dahlbyk/posh-git[]) 下载一份 Posh-Git 的发行版并解压即可。 -接着使用 posh-git.psd1 文件的完整路径导入此模块: + +只需从 https://github.com/dahlbyk/posh-git[] 下载一份 posh-git 的发行版并解压即可。 +接着使用 `posh-git.psd1` 文件的完整路径导入此模块: + [source,powershell] ----- > Import-Module \src\posh-git.psd1 > Add-PoshGitToProfile -AllHosts ----- -它将会向你的 `profile.ps1` 文件添加适当的内容,Posh-Git 将会在下次打开 PowerShell 时启用。 +它将会向你的 `profile.ps1` 文件添加适当的内容,posh-git 将会在下次打开 PowerShell 时启用。 + 命令提示符显示的 Git 状态信息的解释见: https://github.com/dahlbyk/posh-git/blob/master/README.md#git-status-summary-information[] -如何定制 Posh-Git 提示符的详情见: https://github.com/dahlbyk/posh-git/blob/master/README.md#customization-variables[] +如何定制 Posh-Git 提示符的详情见: https://github.com/dahlbyk/posh-git/blob/master/README.md#customization-variables[]。 From 1282925046b710a755ae8840b2e66976108f0cca Mon Sep 17 00:00:00 2001 From: Yuhang Guo <22561797+Sherry520@users.noreply.github.com> Date: Tue, 13 Aug 2024 10:48:51 +0800 Subject: [PATCH 48/67] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E9=99=84=E5=BD=95A?= =?UTF-8?q?=EF=BC=9Aguis=E4=B8=AD=E7=BF=BB=E8=AF=91=E4=B8=8E=E5=8E=9F?= =?UTF-8?q?=E6=96=87=E4=B8=8D=E4=B8=80=E8=87=B4=E7=9A=84=E6=A0=BC=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- book/A-git-in-other-environments/sections/guis.asc | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/book/A-git-in-other-environments/sections/guis.asc b/book/A-git-in-other-environments/sections/guis.asc index ad5efddf..dbbe602b 100644 --- a/book/A-git-in-other-environments/sections/guis.asc +++ b/book/A-git-in-other-environments/sections/guis.asc @@ -66,8 +66,6 @@ image::images/git-gui.png[`git-gui` 提交工具。] `gitk` 和 `git-gui` 就是针对某种任务设计的工具的两个例子。 它们分别为了不同的目的(即查看历史和制作提交)而进行了精简,略去了用不到的功能。 -==== GitHub for macOS and Windows - ==== macOS 和 Windows 上的 GitHub 客户端 (((GitHub for macOS)))(((GitHub for Windows))) @@ -98,7 +96,7 @@ image::images/github_win.png[GitHub Windows 客户端。] ===== 安装 -GitHub 的 Windows 客户端可以从 https://windows.github.com[] 下载,macOS 客户端可以从 https://mac.github.com[]下载。 +GitHub 的 Windows 客户端可以从 https://windows.github.com[] 下载,macOS 客户端可以从 https://mac.github.com[] 下载。 第一次打开软件时,它会引导你进行一系列的首次使用设置,例如设置你的姓名和电子邮件,它还会智能地帮你调整一些常用的默认设置,例如凭证缓存和 CRLF 的处理方式。 它们都是“绿色软件”——如果软件打开发现有更新,下载和安装升级包都是在后台完成的。 @@ -146,9 +144,8 @@ push,fetch,merge,和 rebase 在 Git 内部是一连串独立的操作, 而 开发者和非开发者可以轻松地在分分钟内就搭建起项目协作环境,它们还内置了其它辅助最佳实践的功能。 但是,如果你的工作流程有所不同,或者你需要在进行网络操作时有更多的控制,那么建议你考虑一下其它客户端或者使用命令行。 - ==== 其它图形界面 除此之外,还有许许多多其它的图形化 Git 客户端,其中既有单一功能的定制工具,也有试图提供 Git 所有功能的复杂应用。 Git 的官方网站整理了一份时下最流行的客户端的清单 https://git-scm.com/downloads/guis[]。 -在 Git 的维基站点还可以看到一份更全的清单 https://git.wiki.kernel.org/index.php/Interfaces,_frontends,_and_tools#Graphical_Interfaces[]. +在 Git 的维基站点还可以看到一份更全的清单 https://git.wiki.kernel.org/index.php/Interfaces,_frontends,_and_tools#Graphical_Interfaces[]。 From aea43f8a5998ac38ebc54c3dc0366cbc96fbb65f Mon Sep 17 00:00:00 2001 From: Yuhang Guo <22561797+Sherry520@users.noreply.github.com> Date: Tue, 13 Aug 2024 10:53:27 +0800 Subject: [PATCH 49/67] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E9=99=84=E5=BD=95A?= =?UTF-8?q?=EF=BC=9Ajetbrainsides=E6=9C=AA=E9=81=B5=E5=BE=AA=E5=8E=9F?= =?UTF-8?q?=E6=96=87=E6=AE=B5=E8=90=BD=E6=A0=BC=E5=BC=8F=E7=9A=84=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../A-git-in-other-environments/sections/jetbrainsides.asc | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/book/A-git-in-other-environments/sections/jetbrainsides.asc b/book/A-git-in-other-environments/sections/jetbrainsides.asc index 18df7823..8cff3005 100644 --- a/book/A-git-in-other-environments/sections/jetbrainsides.asc +++ b/book/A-git-in-other-environments/sections/jetbrainsides.asc @@ -1,10 +1,11 @@ === IntelliJ / PyCharm / WebStorm / PhpStorm / RubyMine 中的 Git (((JetBrains))) -JetBrains IDEs(比如 IntelliJ IDEA,PyCharm,WebStorm,PhpStorm,RubyMine,以及其他)自带 Git 集成插件。插件在 IDE 中提供了一个专门的页面,可以使用 Git 和 GitHub 的 Pull Request。 +JetBrains IDEs(比如 IntelliJ IDEA,PyCharm,WebStorm,PhpStorm,RubyMine,以及其他)自带 Git 集成插件。 +在 IDE 中提供了一个专门的页面,可以使用 Git 和 GitHub 的 Pull Request。 .JetBrains IDEs 中的版本控制工具窗口。 image::images/jb.png[JetBrains IDEs 中的版本控制工具窗口。] -该集成插件依赖于 Git 的命令行客户端,所以需要先安装一个 Git 客户端。官方文档请访问: -https://www.jetbrains.com/help/idea/using-git-integration.html 。 \ No newline at end of file +该集成插件依赖于 Git 的命令行客户端,所以需要先安装一个 Git 客户端。 +官方文档请访问 https://www.jetbrains.com/help/idea/using-git-integration.html。 From 0ce83ce96de5795a40a64e267beab87d6b2ddb86 Mon Sep 17 00:00:00 2001 From: Yuhang Guo <22561797+Sherry520@users.noreply.github.com> Date: Mon, 12 Aug 2024 22:01:44 +0800 Subject: [PATCH 50/67] rm eclipse.asc file --- book/A-git-in-other-environments/sections/eclipse.asc | 10 ---------- 1 file changed, 10 deletions(-) delete mode 100644 book/A-git-in-other-environments/sections/eclipse.asc diff --git a/book/A-git-in-other-environments/sections/eclipse.asc b/book/A-git-in-other-environments/sections/eclipse.asc deleted file mode 100644 index d79b25a0..00000000 --- a/book/A-git-in-other-environments/sections/eclipse.asc +++ /dev/null @@ -1,10 +0,0 @@ -=== Eclipse 中的 Git - -(((Eclipse))) -Eclipse 附带了一个名为 Egit 的插件,它提供了一个非常完善的 Git 操作接口。 -这个插件可以通过切换到 Git 视图来使用。( Window > Open Perspective > Other…, 然后选择 “Git” )。 - -.Eclipse 中 EGit 的界面环境。 -image::images/egit.png[Eclipse 中 EGit 的界面环境。] - -EGit 提供了许多强大的帮助文档,你能通过下面的操作来访问它:单击菜单 Help > Help Contents,然后从内容列表中选择 “EGit Documentation” 节点。 From 55231ea7a67242c4c72a6375a35bfcccba53f6a9 Mon Sep 17 00:00:00 2001 From: Yuhang Guo <22561797+Sherry520@users.noreply.github.com> Date: Tue, 13 Aug 2024 11:45:26 +0800 Subject: [PATCH 51/67] =?UTF-8?q?=E9=81=B5=E5=BE=AA=E5=8E=9F=E6=96=87=20?= =?UTF-8?q?=E4=BF=AE=E6=94=B9ruby=E8=84=9A=E6=9C=AC=E8=BF=87=E6=97=B6?= =?UTF-8?q?=E7=9A=84=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- book/07-git-tools/git-credential-read-only | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/book/07-git-tools/git-credential-read-only b/book/07-git-tools/git-credential-read-only index b98833c4..9e984dca 100755 --- a/book/07-git-tools/git-credential-read-only +++ b/book/07-git-tools/git-credential-read-only @@ -11,7 +11,7 @@ OptionParser.new do |opts| end.parse! exit(0) unless ARGV[0].downcase == 'get' # <2> -exit(0) unless File.exists? path +exit(0) unless File.exist? path known = {} # <3> while line = STDIN.gets From cae10b62ad883ba176318312b959d81a266c5ae6 Mon Sep 17 00:00:00 2001 From: Yuhang Guo <22561797+Sherry520@users.noreply.github.com> Date: Wed, 14 Aug 2024 10:50:39 +0800 Subject: [PATCH 52/67] rm include eclipse --- A-git-in-other-environments.asc | 2 -- 1 file changed, 2 deletions(-) diff --git a/A-git-in-other-environments.asc b/A-git-in-other-environments.asc index 128f267f..87bc3305 100644 --- a/A-git-in-other-environments.asc +++ b/A-git-in-other-environments.asc @@ -14,8 +14,6 @@ include::book/A-git-in-other-environments/sections/visualstudio.asc[] include::book/A-git-in-other-environments/sections/visualstudiocode.asc[] -include::book/A-git-in-other-environments/sections/eclipse.asc[] - include::book/A-git-in-other-environments/sections/jetbrainsides.asc[] include::book/A-git-in-other-environments/sections/sublimetext.asc[] From 5137b7d5aa8bff2d716a3603a1f1189f97717263 Mon Sep 17 00:00:00 2001 From: Yuhang Guo <22561797+Sherry520@users.noreply.github.com> Date: Fri, 16 Aug 2024 10:14:16 +0800 Subject: [PATCH 53/67] Add FB2 output --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 724ad441..1d6d2e34 100644 --- a/.gitignore +++ b/.gitignore @@ -7,6 +7,7 @@ progit.html progit.pdf progit.pdfmarks progit.epub +progit.fb2.zip progit-kf8.epub progit.mobi contributors.txt From db00ba8692bf5e810bd365d48752e62897908b6f Mon Sep 17 00:00:00 2001 From: Yuhang Guo <22561797+Sherry520@users.noreply.github.com> Date: Thu, 15 Aug 2024 22:02:35 +0800 Subject: [PATCH 54/67] fixes build without mobi --- Gemfile | 13 +- Rakefile | 366 ++++++++++++++++++++----------------------------------- 2 files changed, 137 insertions(+), 242 deletions(-) diff --git a/Gemfile b/Gemfile index b569101b..7d6e20ee 100644 --- a/Gemfile +++ b/Gemfile @@ -1,22 +1,23 @@ source 'https://rubygems.org' +gem 'ffi', '1.16.3' gem 'rake' -gem 'asciidoctor', '1.5.6.2' +gem 'asciidoctor', '2.0.12' gem 'json' gem 'awesome_print' -gem 'ttfunk', '= 1.5.1' +gem 'ttfunk', '1.5.1' +gem 'asciidoctor-fb2' gem 'asciidoctor-epub3', '1.5.0.alpha.9' gem 'asciidoctor-pdf', '1.5.0.alpha.16' gem 'asciidoctor-pdf-cjk', '~> 0.1.3' -gem 'asciidoctor-pdf-cjk-kai_gen_gothic', '~> 0.1.1' +gem 'asciidoctor-pdf-cjk-kai_gen_gothic', github: 'Sherry520/asciidoctor-pdf-cjk-kai_gen_gothic' gem 'coderay' gem 'pygments.rb' gem 'thread_safe' gem 'epubcheck-ruby' -gem 'kindlegen' +gem 'html-proofer' -gem 'octokit' -gem 'github_changelog_generator', github: 'Furtif/github-changelog-generator' +#gem 'kindlegen', '3.1.1' diff --git a/Rakefile b/Rakefile index 9cbfebc1..c180d2a1 100644 --- a/Rakefile +++ b/Rakefile @@ -1,250 +1,144 @@ -# coding: utf-8 -require 'octokit' -require 'github_changelog_generator' - -def exec_or_raise(command) - puts `#{command}` - if (! $?.success?) - raise "'#{command}' failed" - end -end +namespace :book do -module GitHubChangelogGenerator - - #OPTIONS = %w[ user project token date_format output - # bug_prefix enhancement_prefix issue_prefix - # header merge_prefix issues - # add_issues_wo_labels add_pr_wo_labels - # pulls filter_issues_by_milestone author - # unreleased_only unreleased unreleased_label - # compare_link include_labels exclude_labels - # bug_labels enhancement_labels - # between_tags exclude_tags exclude_tags_regex since_tag max_issues - # github_site github_endpoint simple_list - # future_release release_branch verbose release_url - # base configure_sections add_sections] - - def get_log(&task_block) - options = Parser.default_options - yield(options) if task_block - - options[:user],options[:project] = ENV['TRAVIS_REPO_SLUG'].split('/') - options[:token] = ENV['GITHUB_API_TOKEN'] - options[:unreleased] = false - - generator = Generator.new options - generator.compound_changelog + # Variables referenced for build + version_string = `git describe --tags --abbrev=0`.chomp + if version_string.empty? + version_string = '0' + else + versions = version_string.split('.') + version_string = versions[0] + '.' + versions[1] + '.' + versions[2].to_i.next.to_s + end + lang = "CN" + date_string = Time.now.strftime('%Y-%m-%d') + params = "-r asciidoctor-pdf-cjk -r asciidoctor-pdf-cjk-kai_gen_gothic -a pdf-style=KaiGenGothic#{lang} --attribute revnumber='#{version_string}' --attribute revdate='#{date_string}' --attribute lang='#{lang}' " + header_hash = `git rev-parse --short HEAD`.strip + + # Check contributors list + # This checks commit hash stored in the header of list against current HEAD + def check_contrib + if File.exist?('book/contributors.txt') + current_head_hash = `git rev-parse --short HEAD`.strip + header = `head -n 1 book/contributors.txt`.strip + # Match regex, then coerce resulting array to string by join + header_hash = header.scan(/[a-f0-9]{7,}/).join + + if header_hash == current_head_hash + puts "Hash on header of contributors list (#{header_hash}) matches the current HEAD (#{current_head_hash})" + else + puts "Hash on header of contributors list (#{header_hash}) does not match the current HEAD (#{current_head_hash}), refreshing" + sh "rm book/contributors.txt" + # Reenable and invoke task again + Rake::Task['book/contributors.txt'].reenable + Rake::Task['book/contributors.txt'].invoke + end + end end - module_function :get_log -end - -namespace :book do desc 'build basic book formats' - task :build do - - puts "Generating contributors list" - exec_or_raise("git shortlog -s --all $translation_origin | grep -v -E '(Straub|Chacon)' | cut -f 2- | sort | column -c 110 > book/contributors.txt") - - # detect if the deployment is using glob - travis = File.read(".travis.yml") - version_string = ENV['TRAVIS_TAG'] || '0' - if travis.match(/file_glob/) - progit_v = "progit_v#{version_string}" - else - progit_v = "progit" + task :build => [:build_html, :build_epub, :build_fb2, :build_pdf] do + #task :build => [:build_html, :build_epub, :build_fb2, :build_mobi, :build_pdf] do + begin + # Run check + Rake::Task['book:check'].invoke + + # Rescue to ignore checking errors + rescue => e + puts e.message + puts 'Error when checking books (ignored)' end - text = File.read('progit.asc') - new_contents = text.gsub("$$VERSION$$", version_string).gsub("$$DATE$$", Time.now.strftime("%Y-%m-%d")) - File.open("#{progit_v}.asc", "w") {|file| file.puts new_contents } - - puts "Converting to HTML..." - exec_or_raise("bundle exec asciidoctor #{progit_v}.asc") - puts " -- HTML output at #{progit_v}.html" - - puts "Converting to EPub..." - exec_or_raise("bundle exec asciidoctor-epub3 #{progit_v}.asc") - puts " -- Epub output at #{progit_v}.epub" - - exec_or_raise("epubcheck #{progit_v}.epub") - - puts "Converting to Mobi (kf8)..." - exec_or_raise("bundle exec asciidoctor-epub3 -a ebook-format=kf8 #{progit_v}.asc") - # remove the fake epub that would shadow the really one - exec_or_raise("rm progit*kf8.epub") - puts " -- Mobi output at #{progit_v}.mobi" - - repo = ENV['TRAVIS_REPO_SLUG'] - puts "Converting to PDF... (this one takes a while)" - if (repo == "progit/progit2-zh") - exec_or_raise("asciidoctor-pdf-cjk-kai_gen_gothic-install") - exec_or_raise("bundle exec asciidoctor-pdf -r asciidoctor-pdf-cjk -r asciidoctor-pdf-cjk-kai_gen_gothic -a pdf-style=KaiGenGothicCN #{progit_v}.asc") - elsif (repo == "progit/progit2-ja") - exec_or_raise("asciidoctor-pdf-cjk-kai_gen_gothic-install") - exec_or_raise("bundle exec asciidoctor-pdf -r asciidoctor-pdf-cjk -r asciidoctor-pdf-cjk-kai_gen_gothic -a pdf-style=KaiGenGothicJP #{progit_v}.asc") - elsif (repo == "progit/progit2-zh-tw") - exec_or_raise("asciidoctor-pdf-cjk-kai_gen_gothic-install") - exec_or_raise("bundle exec asciidoctor-pdf -r asciidoctor-pdf-cjk -r asciidoctor-pdf-cjk-kai_gen_gothic -a pdf-style=KaiGenGothicTW #{progit_v}.asc") - elsif (repo == "progit/progit2-ko") - exec_or_raise("asciidoctor-pdf-cjk-kai_gen_gothic-install") - exec_or_raise("bundle exec asciidoctor-pdf -r asciidoctor-pdf-cjk -r asciidoctor-pdf-cjk-kai_gen_gothic -a pdf-style=KaiGenGothicKR #{progit_v}.asc") - else - exec_or_raise("bundle exec asciidoctor-pdf #{progit_v}.asc 2>/dev/null") - end - puts " -- PDF output at #{progit_v}.pdf" end - desc 'tag the repo with the latest version' - task :tag do - api_token = ENV['GITHUB_API_TOKEN'] - if ((api_token) && (ENV['TRAVIS_PULL_REQUEST'] == 'false')) - repo = ENV['TRAVIS_REPO_SLUG'] - @octokit = Octokit::Client.new(:access_token => api_token) - begin - last_version=@octokit.latest_release(repo).tag_name - rescue - last_version="2.1.-1" - end - new_patchlevel= last_version.split('.')[-1].to_i + 1 - new_version="2.1.#{new_patchlevel}" - if (ENV['TRAVIS_BRANCH']=='master') - obj = @octokit.create_tag(repo, new_version, "Version " + new_version, - ENV['TRAVIS_COMMIT'], 'commit', - 'Automatic build', 'automatic@no-domain.org', - Time.now.utc.iso8601) - begin - @octokit.create_ref(repo, "tags/#{new_version}", obj.sha) - rescue - p "the ref already exists ???" - end - p "Created tag #{last_version}" - elsif (ENV['TRAVIS_TAG']) - version = ENV['TRAVIS_TAG'] - changelog = GitHubChangelogGenerator.get_log do |config| - config[:since_tag] = last_version - end - credit_line = "\\* *This Change Log was automatically generated by [github_changelog_generator](https://github.com/skywinder/Github-Changelog-Generator)*" - changelog.gsub!(credit_line, "") - @octokit.create_release(repo, new_version, {:name => "v#{new_version}", :body => changelog}) - p "Created release #{new_version}" - else - p 'This only runs on a commit to master' - end - else - p 'No interaction with GitHub' - end + desc 'build basic book formats (for ci)' + task :ci => [:build_html, :build_epub, :build_fb2, :build_pdf] do + #task :ci => [:build_html, :build_epub, :build_fb2, :build_mobi, :build_pdf] do + # Run check, but don't ignore any errors + Rake::Task['book:check'].invoke end - desc 'convert book to asciidoctor compatibility' - task:convert do - `cp -aR ../progit2/images .` - `sed -i -e 's!/images/!!' .gitignore` - `git add images` - `git rm -r book/*/images` - - chapters = [ - ["01", "introduction" ], - ["02", "git-basics" ], - ["03", "git-branching" ], - ["04", "git-server" ], - ["05", "distributed-git" ], - ["06", "github" ], - ["07", "git-tools" ], - ["08", "customizing-git" ], - ["09", "git-and-other-scms" ], - ["10", "git-internals" ], - ["A", "git-in-other-environments" ], - ["B", "embedding-git" ], - ["C", "git-commands" ] - ] - - crossrefs = {} - chapters.each { | num, title | - if num =~ /[ABC]/ - chap = "#{num}-#{title}" - else - chap = "ch#{num}-#{title}" - end - Dir[File.join ["book","#{num}-#{title}" , "sections","*.asc"]].map { |filename| - File.read(filename).scan(/\[\[(.*?)\]\]/) - }.flatten.each { |ref| - crossrefs[ref] = "#{chap}" - } - } - - headrefs = {} - chapters.each { | num, title | - if num =~ /[ABC]/ - chap = "#{num}-#{title}" - else - chap = "ch#{num}-#{title}" - end - Dir[File.join ["book","#{num}-#{title}", "*.asc"]].map { |filename| - File.read(filename).scan(/\[\[([_a-z0-9]*?)\]\]/) - }.flatten.each { |ref| - headrefs[ref] = "#{chap}" - } - } - - # transform all internal cross refs - chapters.each { | num, title | - if num =~ /[ABC]/ - chap = "#{num}-#{title}" - else - chap = "ch#{num}-#{title}" - end - files = Dir[File.join ["book","#{num}-#{title}" , "sections","*.asc"]] + - Dir[File.join ["book","#{num}-#{title}" ,"1-*.asc"]] - p files - files.each { |filename| - content = File.read(filename) - new_contents = content.gsub(/\[\[([_a-z0-9]*?)\]\]/, '[[r\1]]').gsub( - "→", "→").gsub(/<<([_a-z0-9]*?)>>/) { |match| - ch = crossrefs[$1] - h = headrefs[$1] - # p " #{match} -> #{ch}, #{h}" - if ch - # if local do not add the file - if ch==chap - "<>" - else - "<<#{ch}#r#{$1}>>" - end - elsif h - if h==chap - "<<#{chap}>>" - else - "<<#{h}##{h}>>" - end - else - p "could not match xref #{$1}" - "<<#{$1}>>" - end - } - File.open(filename, "w") {|file| file.puts new_contents } - } - } - - chapters.each { | num, title | - if num =~ /[ABC]/ - chap = "#{num}-#{title}" - else - chap = "ch#{num}-#{title}" - end - Dir[File.join ["book","#{num}-#{title}" ,"1*.asc"]].map { |filename| - content = File.read (filename) - new_contents = content.gsub(/include::(.*?)asc/) {|match| - "include::book/#{num}-#{title}/#{$1}asc"} - `git rm -f #{filename}` - File.open("#{chap}.asc", "w") {|file| - file.puts "[##{chap}]\n" - file.puts new_contents } - `git add "#{chap}.asc"` - } - } + desc 'generate contributors list' + file 'book/contributors.txt' do + puts 'Generating contributors list' + sh "echo 'Contributors as of #{header_hash}:\n' > book/contributors.txt" + sh "git shortlog -s HEAD | grep -v -E '(Straub|Chacon|dependabot)' | cut -f 2- | sort | column -c 120 >> book/contributors.txt" end -end + desc 'build HTML format' + task :build_html => 'book/contributors.txt' do + check_contrib() + puts 'Converting to HTML...' + sh "bundle exec asciidoctor #{params} -a data-uri progit.asc" + puts ' -- HTML output at progit.html' + + end + + desc 'build Epub format' + task :build_epub => 'book/contributors.txt' do + check_contrib() + + puts 'Converting to EPub...' + sh "bundle exec asciidoctor-epub3 #{params} progit.asc" + puts ' -- Epub output at progit.epub' + + end + + desc 'build FB2 format' + task :build_fb2 => 'book/contributors.txt' do + check_contrib() + + puts 'Converting to FB2...' + sh "bundle exec asciidoctor-fb2 #{params} progit.asc" + puts ' -- FB2 output at progit.fb2.zip' + + end + +=begin + desc 'build Mobi format' + task :build_mobi => 'book/contributors.txt' do + check_contrib() + + puts "Converting to Mobi (kf8)..." + sh "bundle exec asciidoctor-epub3 #{params} -a ebook-format=kf8 progit.asc" + puts " -- Mobi output at progit.mobi" + end +=end + + desc 'build PDF format' + task :build_pdf => 'book/contributors.txt' do + check_contrib() + + puts 'Converting to PDF... (this one takes a while)' + sh "bundle exec asciidoctor-pdf #{params} progit.asc 2>/dev/null" + puts ' -- PDF output at progit.pdf' + end + + desc 'Check generated books' + task :check => [:build_html, :build_epub] do + puts 'Checking generated books' + + sh "htmlproofer progit.html" + sh "epubcheck progit.epub" + end + + desc 'Clean all generated files' + task :clean do + begin + puts 'Removing generated files' + + FileList['book/contributors.txt', 'progit.html', 'progit-kf8.epub', 'progit.epub', 'progit.fb2.zip', 'progit.pdf'].each do |file| + #FileList['book/contributors.txt', 'progit.html', 'progit-kf8.epub', 'progit.epub', 'progit.fb2.zip', 'progit.mobi', 'progit.pdf'].each do |file| + rm file + + # Rescue if file not found + rescue Errno::ENOENT => e + begin + puts e.message + puts 'Error removing files (ignored)' + end + end + end + end + +end task :default => "book:build" From be5cc06c32b6611e21f10fc05c548a30e1f35d97 Mon Sep 17 00:00:00 2001 From: Yuhang Guo <22561797+Sherry520@users.noreply.github.com> Date: Fri, 16 Aug 2024 10:55:18 +0800 Subject: [PATCH 55/67] auto download CJK fonts --- Rakefile | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/Rakefile b/Rakefile index c180d2a1..5ed934a4 100644 --- a/Rakefile +++ b/Rakefile @@ -1,5 +1,15 @@ +def exec_or_raise(command) + puts `#{command}` + if (! $?.success?) + raise "'#{command}' failed" + end +end + namespace :book do + # Download asciidoctor-pdf-cjk-kai_gen_gothic + exec_or_raise("asciidoctor-pdf-cjk-kai_gen_gothic-install") + # Variables referenced for build version_string = `git describe --tags --abbrev=0`.chomp if version_string.empty? From 184d99a5a894f639cb23bb245f5991fb3f6dca71 Mon Sep 17 00:00:00 2001 From: Yuhang Guo <22561797+Sherry520@users.noreply.github.com> Date: Fri, 16 Aug 2024 11:00:55 +0800 Subject: [PATCH 56/67] allow build mobi --- Gemfile | 2 +- Rakefile | 11 +++-------- 2 files changed, 4 insertions(+), 9 deletions(-) diff --git a/Gemfile b/Gemfile index 7d6e20ee..40c76af4 100644 --- a/Gemfile +++ b/Gemfile @@ -20,4 +20,4 @@ gem 'thread_safe' gem 'epubcheck-ruby' gem 'html-proofer' -#gem 'kindlegen', '3.1.1' +gem 'kindlegen', '3.1.1' diff --git a/Rakefile b/Rakefile index 5ed934a4..1e81b342 100644 --- a/Rakefile +++ b/Rakefile @@ -45,8 +45,7 @@ namespace :book do end desc 'build basic book formats' - task :build => [:build_html, :build_epub, :build_fb2, :build_pdf] do - #task :build => [:build_html, :build_epub, :build_fb2, :build_mobi, :build_pdf] do + task :build => [:build_html, :build_epub, :build_fb2, :build_mobi, :build_pdf] do begin # Run check Rake::Task['book:check'].invoke @@ -59,8 +58,7 @@ namespace :book do end desc 'build basic book formats (for ci)' - task :ci => [:build_html, :build_epub, :build_fb2, :build_pdf] do - #task :ci => [:build_html, :build_epub, :build_fb2, :build_mobi, :build_pdf] do + task :ci => [:build_html, :build_epub, :build_fb2, :build_mobi, :build_pdf] do # Run check, but don't ignore any errors Rake::Task['book:check'].invoke end @@ -102,7 +100,6 @@ namespace :book do end -=begin desc 'build Mobi format' task :build_mobi => 'book/contributors.txt' do check_contrib() @@ -111,7 +108,6 @@ namespace :book do sh "bundle exec asciidoctor-epub3 #{params} -a ebook-format=kf8 progit.asc" puts " -- Mobi output at progit.mobi" end -=end desc 'build PDF format' task :build_pdf => 'book/contributors.txt' do @@ -135,8 +131,7 @@ namespace :book do begin puts 'Removing generated files' - FileList['book/contributors.txt', 'progit.html', 'progit-kf8.epub', 'progit.epub', 'progit.fb2.zip', 'progit.pdf'].each do |file| - #FileList['book/contributors.txt', 'progit.html', 'progit-kf8.epub', 'progit.epub', 'progit.fb2.zip', 'progit.mobi', 'progit.pdf'].each do |file| + FileList['book/contributors.txt', 'progit.html', 'progit-kf8.epub', 'progit.epub', 'progit.fb2.zip', 'progit.mobi', 'progit.pdf'].each do |file| rm file # Rescue if file not found From 405cd94c7b3faff751b7ea8931d56762999f8a5d Mon Sep 17 00:00:00 2001 From: Yuhang Guo <22561797+Sherry520@users.noreply.github.com> Date: Fri, 16 Aug 2024 13:39:31 +0800 Subject: [PATCH 57/67] modify pr-build workflow --- .github/workflows/pr-build.yml | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/.github/workflows/pr-build.yml b/.github/workflows/pr-build.yml index 20bbc0d4..c030ebf8 100644 --- a/.github/workflows/pr-build.yml +++ b/.github/workflows/pr-build.yml @@ -10,10 +10,6 @@ jobs: steps: - uses: actions/checkout@v2 - - name: Download bootstrap file - run: wget https://raw.githubusercontent.com/progit/progit2-pub/master/bootstrap.sh - - name: Run bootstrap - run: sh bootstrap.sh - name: Set up Ruby uses: ruby/setup-ruby@v1 with: @@ -21,4 +17,4 @@ jobs: bundler-cache: true # runs 'bundle install' and caches installed gems automatically - name: Build book - run: bundle exec rake book:build_action + run: bundle exec rake book:build From 26ce1337358e621eeb9cd965ca5afc4dd0728598 Mon Sep 17 00:00:00 2001 From: Yuhang Guo <22561797+Sherry520@users.noreply.github.com> Date: Fri, 16 Aug 2024 14:12:56 +0800 Subject: [PATCH 58/67] change github action version --- .github/workflows/pr-build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pr-build.yml b/.github/workflows/pr-build.yml index c030ebf8..4eabd25a 100644 --- a/.github/workflows/pr-build.yml +++ b/.github/workflows/pr-build.yml @@ -8,7 +8,7 @@ jobs: build: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: Set up Ruby uses: ruby/setup-ruby@v1 From fcd6e3f7c1776b894544c7426b89ebce85275b83 Mon Sep 17 00:00:00 2001 From: Yuhang Guo <22561797+Sherry520@users.noreply.github.com> Date: Fri, 16 Aug 2024 14:55:41 +0800 Subject: [PATCH 59/67] support for auto select CJK language --- Rakefile | 28 ++++++++++++++++++++++++++-- 1 file changed, 26 insertions(+), 2 deletions(-) diff --git a/Rakefile b/Rakefile index 1e81b342..cb01f185 100644 --- a/Rakefile +++ b/Rakefile @@ -18,10 +18,34 @@ namespace :book do versions = version_string.split('.') version_string = versions[0] + '.' + versions[1] + '.' + versions[2].to_i.next.to_s end - lang = "CN" date_string = Time.now.strftime('%Y-%m-%d') - params = "-r asciidoctor-pdf-cjk -r asciidoctor-pdf-cjk-kai_gen_gothic -a pdf-style=KaiGenGothic#{lang} --attribute revnumber='#{version_string}' --attribute revdate='#{date_string}' --attribute lang='#{lang}' " header_hash = `git rev-parse --short HEAD`.strip + + # Check language + repo = File.basename(`git rev-parse --show-toplevel`.chomp) + lang_match = repo.match(/progit2-([a-z-]*)/) + if lang_match + lang = lang_match[1] + else + lang = "en" + end + + begin + if lang == "zh" + params = "-r asciidoctor-pdf-cjk -r asciidoctor-pdf-cjk-kai_gen_gothic -a pdf-style=KaiGenGothicCN --attribute revnumber='#{version_string}' --attribute revdate='#{date_string}' --attribute lang='#{lang}'" + elsif lang == "zh-tw" + params = "-r asciidoctor-pdf-cjk -r asciidoctor-pdf-cjk-kai_gen_gothic -a pdf-style=KaiGenGothicTW --attribute revnumber='#{version_string}' --attribute revdate='#{date_string}' --attribute lang='#{lang}'" + elsif lang == "ja" + params = "-r asciidoctor-pdf-cjk -r asciidoctor-pdf-cjk-kai_gen_gothic -a pdf-style=KaiGenGothicJP --attribute revnumber='#{version_string}' --attribute revdate='#{date_string}' --attribute lang='#{lang}'" + elsif lang == "ko" + params = "-r asciidoctor-pdf-cjk -r asciidoctor-pdf-cjk-kai_gen_gothic -a pdf-style=KaiGenGothicKR --attribute revnumber='#{version_string}' --attribute revdate='#{date_string}' --attribute lang='#{lang}'" + else + params = "--attribute revnumber='#{version_string}' --attribute revdate='#{date_string}'" + end + rescue => e + puts e.message + puts 'Error when checking repo language(ignored)' + end # Check contributors list # This checks commit hash stored in the header of list against current HEAD From 2d384599d2f5a4085592df947b95ae82fb4de6b9 Mon Sep 17 00:00:00 2001 From: Yuhang Guo <22561797+Sherry520@users.noreply.github.com> Date: Fri, 16 Aug 2024 15:20:14 +0800 Subject: [PATCH 60/67] update release on merge workflow --- .github/workflows/release-on-merge.yml | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/.github/workflows/release-on-merge.yml b/.github/workflows/release-on-merge.yml index 3c877b87..7efabb3d 100644 --- a/.github/workflows/release-on-merge.yml +++ b/.github/workflows/release-on-merge.yml @@ -8,13 +8,9 @@ jobs: release: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 with: fetch-depth: 0 - - name: get bootstrap file - run: wget https://raw.githubusercontent.com/progit/progit2-pub/master/bootstrap.sh - - name: run bootstrap - run: sh bootstrap.sh - name: Compute tag name id: compute-tag run: | @@ -31,7 +27,7 @@ jobs: bundler-cache: true # runs 'bundle install' and caches installed gems automatically - name: Build release assets - run: bundle exec rake book:build_action + run: bundle exec rake book:build_build - name: Create release uses: ncipollo/release-action@v1 @@ -39,4 +35,4 @@ jobs: token: ${{ secrets.GITHUB_TOKEN }} tag: ${{ steps.compute-tag.outputs.tagname }} commit: ${{ steps.compute-tag.outputs.branch }} - artifacts: './progit.epub,./progit.mobi,./progit.pdf,./progit.html' + artifacts: './progit.epub,./progit.fb2.zip,./progit.mobi,./progit.pdf,./progit.html' From 89945f7b3ad9369051ca8aa4906a099954f28afb Mon Sep 17 00:00:00 2001 From: Yuhang Guo <22561797+Sherry520@users.noreply.github.com> Date: Fri, 16 Aug 2024 15:51:41 +0800 Subject: [PATCH 61/67] update asciidoctor-epub3 to 1.5.0.alpha.11 --- Gemfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile b/Gemfile index 40c76af4..751a5956 100644 --- a/Gemfile +++ b/Gemfile @@ -9,7 +9,7 @@ gem 'awesome_print' gem 'ttfunk', '1.5.1' gem 'asciidoctor-fb2' -gem 'asciidoctor-epub3', '1.5.0.alpha.9' +gem 'asciidoctor-epub3', '1.5.0.alpha.11' gem 'asciidoctor-pdf', '1.5.0.alpha.16' gem 'asciidoctor-pdf-cjk', '~> 0.1.3' gem 'asciidoctor-pdf-cjk-kai_gen_gothic', github: 'Sherry520/asciidoctor-pdf-cjk-kai_gen_gothic' From c70c5ea20956fa25b4ed1609d890f8857e496d94 Mon Sep 17 00:00:00 2001 From: Yuhang Guo <22561797+Sherry520@users.noreply.github.com> Date: Fri, 16 Aug 2024 23:32:02 +0800 Subject: [PATCH 62/67] =?UTF-8?q?=E9=81=B5=E5=BE=AA=E5=8E=9F=E6=96=87?= =?UTF-8?q?=E6=9B=B4=E6=96=B0=20README?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.asc | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/README.asc b/README.asc index bd1434e2..dc82cf26 100644 --- a/README.asc +++ b/README.asc @@ -34,6 +34,33 @@ Converting to PDF... -- PDF output at progit.pdf ---- +你可以只生成一种支持的格式( HTML、EPUB、mobi、或 PDF )。 +使用以下命令之一: + +生成 HTML 图书: + +---- +$ bundle exec rake book:build_html +---- + +生成 EPUB 图书: + +---- +$ bundle exec rake book:build_epub +---- + +生成 mobi 图书: + +---- +$ bundle exec rake book:build_mobi +---- + +生成 PDF 图书: + +---- +$ bundle exec rake book:build_pdf +---- + ## 发起一个 Issue 在发起一个 Issue 前,请在 bug 跟踪系统中搜索是否已有类似的问题。 From 24212b2f2366cebe94ac3aa156064f9cc511066d Mon Sep 17 00:00:00 2001 From: Yuhang Guo <22561797+Sherry520@users.noreply.github.com> Date: Sat, 17 Aug 2024 00:18:12 +0800 Subject: [PATCH 63/67] fixes release workflow --- .github/workflows/release-on-merge.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release-on-merge.yml b/.github/workflows/release-on-merge.yml index 7efabb3d..4a19fe08 100644 --- a/.github/workflows/release-on-merge.yml +++ b/.github/workflows/release-on-merge.yml @@ -27,7 +27,7 @@ jobs: bundler-cache: true # runs 'bundle install' and caches installed gems automatically - name: Build release assets - run: bundle exec rake book:build_build + run: bundle exec rake book:build - name: Create release uses: ncipollo/release-action@v1 From 5f24875b3a64c6faf0f1d95210c59967a9a37c7a Mon Sep 17 00:00:00 2001 From: Yuhang Guo <22561797+Sherry520@users.noreply.github.com> Date: Sat, 17 Aug 2024 10:22:19 +0800 Subject: [PATCH 64/67] GitHub Actions: Deprecating set-output commands --- .github/workflows/release-on-merge.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release-on-merge.yml b/.github/workflows/release-on-merge.yml index 4a19fe08..109383f0 100644 --- a/.github/workflows/release-on-merge.yml +++ b/.github/workflows/release-on-merge.yml @@ -17,8 +17,8 @@ jobs: echo Computing next tag number LASTPATCH=$(git describe --tags | cut -d- -f1 | cut -d. -f3) PATCH=$(($LASTPATCH+1)) - echo "::set-output name=tagname::2.1.${PATCH}" - echo "::set-output name=branch::${GITHUB_REF#refs/heads/}" + echo "tagname=2.1.${PATCH}" >> $GITHUB_OUTPUT + echo "branch=${GITHUB_REF#refs/heads/}" >> $GITHUB_OUTPUT - name: Set up Ruby uses: ruby/setup-ruby@v1 From 830bde277e33b1cc4798c579dad484bddab9cb42 Mon Sep 17 00:00:00 2001 From: Yuhang Guo <22561797+Sherry520@users.noreply.github.com> Date: Tue, 20 Aug 2024 19:25:30 +0800 Subject: [PATCH 65/67] Update C-git-commands.asc --- C-git-commands.asc | 33 +++++++++++++++------------------ 1 file changed, 15 insertions(+), 18 deletions(-) diff --git a/C-git-commands.asc b/C-git-commands.asc index 88d6a418..a75a46d7 100644 --- a/C-git-commands.asc +++ b/C-git-commands.asc @@ -18,8 +18,7 @@ === 设置与配置 -有两个十分常用的命令:`config` 和 `help`。 -从第一次调用 Git 到日常微调及阅读参考,它们一直陪伴着你。 +有两个十分常用的命令:`config` 和 `help`。从第一次调用 Git 到日常微调及阅读参考,它们一直陪伴着你。 ==== git config @@ -52,22 +51,25 @@ Git 做的很多工作都有一种默认方式。 |============================== |编辑器 | 设置命令 |Atom |`git config --global core.editor "atom --wait"` -|BBEdit (Mac, with command line tools) |`git config --global core.editor "bbedit -w"` +|BBEdit (macOS, with command line tools) |`git config --global core.editor "bbedit -w"` |Emacs |`git config --global core.editor emacs` |Gedit (Linux) |`git config --global core.editor "gedit --wait --new-window"` -|Gvim (Windows 64-bit) |`git config --global core.editor "'C:/Program Files/Vim/vim72/gvim.exe' --nofork '%*'"` (Also see note below) -|Kate (Linux) |`git config --global core.editor "kate"` +|Gvim (Windows 64-bit) |`git config --global core.editor "'C:\Program Files\Vim\vim72\gvim.exe' --nofork '%*'"` (Also see note below) +|Helix |`git config --global core.editor "hx"` +|Kate (Linux) |`git config --global core.editor "kate --block"` |nano |`git config --global core.editor "nano -w"` |Notepad (Windows 64-bit) |`git config core.editor notepad` -|Notepad++ (Windows 64-bit) |`git config --global core.editor "'C:/Program Files/Notepad++/notepad++.exe' -multiInst -notabbar -nosession -noPlugin"` (Also see note below) +|Notepad++ (Windows 64-bit) |`git config --global core.editor "'C:\Program Files\Notepad++\notepad++.exe' -multiInst -notabbar -nosession -noPlugin"` (Also see note below) |Scratch (Linux)|`git config --global core.editor "scratch-text-editor"` |Sublime Text (macOS) |`git config --global core.editor "/Applications/Sublime\ Text.app/Contents/SharedSupport/bin/subl --new-window --wait"` -|Sublime Text (Windows 64-bit) |`git config --global core.editor "'C:/Program Files/Sublime Text 3/sublime_text.exe' -w"` (Also see note below) -|TextEdit (macOS)|`git config --global --add core.editor "open -W -n"` +|Sublime Text (Windows 64-bit) |`git config --global core.editor "'C:\Program Files\Sublime Text 3\sublime_text.exe' -w"` (Also see note below) +|TextEdit (macOS)|`git config --global core.editor "open --wait-apps --new -e"` |Textmate |`git config --global core.editor "mate -w"` -|Textpad (Windows 64-bit) |`git config --global core.editor "'C:/Program Files/TextPad 5/TextPad.exe' -m` (Also see note below) -|Vim |`git config --global core.editor "vim"` -|VS Code |`git config --global core.editor "code --wait"` +|Textpad (Windows 64-bit) |`git config --global core.editor "'C:\Program Files\TextPad 5\TextPad.exe' -m` (Also see note below) +|UltraEdit (Windows 64-bit) | `git config --global core.editor Uedit32` +|Vim |`git config --global core.editor "vim --nofork"` +|Visual Studio Code |`git config --global core.editor "code --wait"` +|VSCodium (Free/Libre Open Source Software Binaries of VSCode) | `git config --global core.editor "codium --wait"` |WordPad |`git config --global core.editor '"C:\Program Files\Windows NT\Accessories\wordpad.exe"'"` |Xi | `git config --global core.editor "xi --wait"` |============================== @@ -84,7 +86,6 @@ Git 做的很多工作都有一种默认方式。 我们在 <> 一节中介绍了 `git help` 命令,同时在 <> 一节中给你展示了如何使用它来查找更多关于 `git shell` 的信息。 - === 获取与创建项目 有几种方式获取一个 Git 仓库。 @@ -119,7 +120,6 @@ Git 做的很多工作都有一种默认方式。 虽然在本书的其他地方都有用到此命令,但是上面这些用法是特例,或者使用方式有点特别。 - === 快照基础 对于基本的暂存内容及提交到你的历史记录中的工作流,只有少数基本的命令。 @@ -312,7 +312,6 @@ Git 有几个实现大部的分支及合并功能的实用命令。 我也在 <> 一节中介绍了如何使用 `-s` 标志创建一个 GPG 签名的标签,然后使用 `-v` 选项来验证。 - === 项目分享与更新 在 Git 中没有多少访问网络的命令,几乎所以的命令都是在操作本地的数据库。 @@ -414,7 +413,6 @@ Git 有几个实现大部的分支及合并功能的实用命令。 我们在 <> 及 <> 章节中使用 `git describe` 命令来获得一个字符串来命名我们发布的文件。 - === 调试 Git 有一些命令可以用来帮你调试你代码中的问题。 @@ -496,14 +494,14 @@ Git 中的一些命令是以引入的变更即提交这样的概念为中心的 ==== git format-patch - `git format-patch` 命令用来以 mbox 的格式来生成一系列的补丁以便你可以发送到一个邮件列表中。 我们在 <> 一节中研究了一个使用 `git format-patch` 工具为一个项目做贡献的示例。 - ==== git imap-send + `git imap-send` 将一个由 `git format-patch` 生成的邮箱上传至 IMAP 草稿文件夹。 + 我们在 <> 一节中见过一个通过使用 `git imap-send` 工具向一个项目发送补丁进行贡献的例子。 ==== git send-email @@ -549,7 +547,6 @@ Git 有一些可以与其他的版本控制系统集成的命令。 ==== git fsck - `git fsck` 命令用来检查内部数据库的问题或者不一致性。 我们只在 <> 这一节中快速使用了一次此命令来搜索所有的悬空对象(dangling object)。 From b07970a40d81c21ae00aa34e5a41914247a422a1 Mon Sep 17 00:00:00 2001 From: Yuhang Guo <22561797+Sherry520@users.noreply.github.com> Date: Tue, 20 Aug 2024 21:38:09 +0800 Subject: [PATCH 66/67] Fix issue 525 --- C-git-commands.asc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/C-git-commands.asc b/C-git-commands.asc index a75a46d7..90a41e08 100644 --- a/C-git-commands.asc +++ b/C-git-commands.asc @@ -59,7 +59,7 @@ Git 做的很多工作都有一种默认方式。 |Kate (Linux) |`git config --global core.editor "kate --block"` |nano |`git config --global core.editor "nano -w"` |Notepad (Windows 64-bit) |`git config core.editor notepad` -|Notepad++ (Windows 64-bit) |`git config --global core.editor "'C:\Program Files\Notepad++\notepad++.exe' -multiInst -notabbar -nosession -noPlugin"` (Also see note below) +|Notepad++ (Windows 64-bit) |`git config --global core.editor "'C:\Program Files\Notepad\++\notepad++.exe' -multiInst -notabbar -nosession -noPlugin"` (Also see note below) |Scratch (Linux)|`git config --global core.editor "scratch-text-editor"` |Sublime Text (macOS) |`git config --global core.editor "/Applications/Sublime\ Text.app/Contents/SharedSupport/bin/subl --new-window --wait"` |Sublime Text (Windows 64-bit) |`git config --global core.editor "'C:\Program Files\Sublime Text 3\sublime_text.exe' -w"` (Also see note below) From 72233a61d8220e3a513da434d2aa7063ad10c777 Mon Sep 17 00:00:00 2001 From: Yuhang Guo <22561797+Sherry520@users.noreply.github.com> Date: Tue, 20 Aug 2024 22:22:00 +0800 Subject: [PATCH 67/67] =?UTF-8?q?=E4=BF=AE=E6=AD=A3=E9=94=99=E8=AF=AF?= =?UTF-8?q?=E7=9A=84=E4=BB=A3=E7=A0=81=E7=AC=A6=E5=8F=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- C-git-commands.asc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/C-git-commands.asc b/C-git-commands.asc index 90a41e08..fce7fa42 100644 --- a/C-git-commands.asc +++ b/C-git-commands.asc @@ -65,12 +65,12 @@ Git 做的很多工作都有一种默认方式。 |Sublime Text (Windows 64-bit) |`git config --global core.editor "'C:\Program Files\Sublime Text 3\sublime_text.exe' -w"` (Also see note below) |TextEdit (macOS)|`git config --global core.editor "open --wait-apps --new -e"` |Textmate |`git config --global core.editor "mate -w"` -|Textpad (Windows 64-bit) |`git config --global core.editor "'C:\Program Files\TextPad 5\TextPad.exe' -m` (Also see note below) +|Textpad (Windows 64-bit) |`git config --global core.editor "'C:\Program Files\TextPad 5\TextPad.exe' -m"` (Also see note below) |UltraEdit (Windows 64-bit) | `git config --global core.editor Uedit32` |Vim |`git config --global core.editor "vim --nofork"` |Visual Studio Code |`git config --global core.editor "code --wait"` |VSCodium (Free/Libre Open Source Software Binaries of VSCode) | `git config --global core.editor "codium --wait"` -|WordPad |`git config --global core.editor '"C:\Program Files\Windows NT\Accessories\wordpad.exe"'"` +|WordPad |`git config --global core.editor "'C:\Program Files\Windows NT\Accessories\wordpad.exe'"` |Xi | `git config --global core.editor "xi --wait"` |==============================