From d9a4314465d15109800ecedfaefba484f5ef3633 Mon Sep 17 00:00:00 2001 From: Wendal Chen Date: Sun, 25 Aug 2013 19:29:07 +0800 Subject: [PATCH 01/19] =?UTF-8?q?fix=20wendal=E7=9A=84blog=E5=9C=B0?= =?UTF-8?q?=E5=9D=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 博客地址很早就改了... --- layout/pdf_template.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/layout/pdf_template.html b/layout/pdf_template.html index d6c6a46b..4a7f7789 100644 --- a/layout/pdf_template.html +++ b/layout/pdf_template.html @@ -78,8 +78,8 @@

中文版 Maintainer / Editor

liuhui998 (liuhui998@gmail.com),(http://liuhui998.com)
liu Wei (liuw@liuw.name),(http://blog.liuw.name)
- Wendal Chen(wendal1985@gmail.com),(http://sunfarms.net/myblog)
- Jiancong Guo(guojiancong0121@gmail.com),(http://www.cbpm-gw.com)
+ Wendal Chen(wendal1985@gmail.com),(http://wendal.net)
+ Jiancong Guo(guojiancong0121@gmail.com),(http://www.cbpm-gw.com)

中文版网址

From 6a5688aee1f3ac6cd37f6975a9d07ece14d01689 Mon Sep 17 00:00:00 2001 From: Lance7in Date: Fri, 15 Nov 2013 16:22:02 +0800 Subject: [PATCH 02/19] =?UTF-8?q?=E4=BF=AE=E6=AD=A3=E6=96=87=E5=AD=97?= =?UTF-8?q?=E8=BE=93=E5=85=A5=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- text_zh/01_Introduction/0_ Introduction.markdown | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/text_zh/01_Introduction/0_ Introduction.markdown b/text_zh/01_Introduction/0_ Introduction.markdown index 1c34fa0b..1c4d3b7e 100644 --- a/text_zh/01_Introduction/0_ Introduction.markdown +++ b/text_zh/01_Introduction/0_ Introduction.markdown @@ -8,7 +8,7 @@ 此书将以介绍Git如何存储数据做为开始,让你了解它和其它版本控制系统有什么不同的背景。这大约要花你20分钟的时间。 -接下来,我们会讲一些Git的**基本用法**,那些你将在90%的时间都在使用的命令。这些东东能给一个不错的使用的基础,也许这些命令就是你将使用的全部命令。这一节大约会你30分钟的时间来读。 +接下来,我们会讲一些Git的**基本用法**,那些你将在90%的时间都在使用的命令。这些东东能给一个不错的使用的基础,也许这些命令就是你将使用的全部命令。这一节大约会花你30分钟的时间来读。 其后,我们会讲一些稍微复杂的**Git中级用法**,这些用法也许会替换掉前面的基本用法。在你了解前面的基本用法后, 这些看起来像魔术一样的命令,你可能会用起来很爽。 From cec30cb72f9ed75824b3ad2a1ad49262e60cabb6 Mon Sep 17 00:00:00 2001 From: Lance7in Date: Fri, 15 Nov 2013 17:08:04 +0800 Subject: [PATCH 03/19] =?UTF-8?q?=E8=A1=A5=E5=85=A8=E6=9C=AA=E7=BF=BB?= =?UTF-8?q?=E8=AF=91=E7=9A=84=E9=83=A8=E5=88=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...ibuted_Workflows_Clone_Fetch_Push.markdown | 21 +++++++------------ 1 file changed, 8 insertions(+), 13 deletions(-) diff --git a/text_zh/11_Distributed_Workflows_Clone_Fetch_Push/0_ Distributed_Workflows_Clone_Fetch_Push.markdown b/text_zh/11_Distributed_Workflows_Clone_Fetch_Push/0_ Distributed_Workflows_Clone_Fetch_Push.markdown index 5cf9c1af..f692f22e 100644 --- a/text_zh/11_Distributed_Workflows_Clone_Fetch_Push/0_ Distributed_Workflows_Clone_Fetch_Push.markdown +++ b/text_zh/11_Distributed_Workflows_Clone_Fetch_Push/0_ Distributed_Workflows_Clone_Fetch_Push.markdown @@ -227,20 +227,15 @@ branch..remote, 和remote..push等选项的解释. $ git push ssh://yourserver.com/~you/proj.git +master -Normally whenever a branch head in a public repository is modified, it -is modified to point to a descendant of the commit that it pointed to -before. By forcing a push in this situation, you break that convention. +通常不论公共仓库的分支是否被修改,他都被修改为指向原来指向的提交(commit) +跟随的下一个提交(commit)。如果在这种情况下强制地推送,你就破坏了之前的约定。 +尽管如此,这也是一种通常的用法来简单地发布一系列正在修正的补丁,并且只要你 +通知了其他的开发者你打算怎样操作这个分支,这也是一种可以接受的折中办法。 -Nevertheless, this is a common practice for people that need a simple -way to publish a work-in-progress patch series, and it is an acceptable -compromise as long as you warn other developers that this is how you -intend to manage the branch. - -It's also possible for a push to fail in this way when other people have -the right to push to the same repository. In that case, the correct -solution is to retry the push after first updating your work: either by a -pull, or by a fetch followed by a rebase; see the next section and -linkgit:gitcvs-migration[7] for more. +一个推送(push)也可能因为其他人有向这个仓库(repository)推送的权利而失败。 +在这种情况下,正确地解决办法是首先用"pull"命令或者"fetch"命令和"rebase" +命令更新你的代码,然后重新尝试推送(push);更详细的了解请看下一部分和 +linkgit:gitcvs-migration[7]。 [gitcast:c8-dist-workflow]("GitCast #8: Distributed Workflow") From 4bc02d58a86640f25227b79ab6f5ce26abe5ed46 Mon Sep 17 00:00:00 2001 From: Harry Chen Date: Mon, 10 Feb 2014 19:33:53 +0800 Subject: [PATCH 04/19] =?UTF-8?q?=E6=A0=A1=E5=AF=B9Git=20Hooks=E7=9A=84?= =?UTF-8?q?=E5=89=8D=E5=8D=8A=E9=83=A8=E5=88=86=E7=BF=BB=E8=AF=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 原来的翻译者太过敷衍,没翻译好就放了上来。 修正大量错误,统一格式。 会继续的。 Signed-off-by: Harry Chen<373685963@qq.com> --- text_zh/31_Git_Hooks/0_ Git_Hooks.markdown | 75 +++++++++------------- 1 file changed, 30 insertions(+), 45 deletions(-) diff --git a/text_zh/31_Git_Hooks/0_ Git_Hooks.markdown b/text_zh/31_Git_Hooks/0_ Git_Hooks.markdown index 605bf095..4ad3dfd6 100755 --- a/text_zh/31_Git_Hooks/0_ Git_Hooks.markdown +++ b/text_zh/31_Git_Hooks/0_ Git_Hooks.markdown @@ -1,66 +1,55 @@ ## Git Hooks ## -钩子(hooks)是一些在"$GIT-DIR/hooks"目录的脚本, 在被特定的事件(certain points)触发后被调用。当"git init"命令被调用后, 一些非常有用的示例钩子文件(hooks)被拷到新仓库的hooks目录中; 但是在默认情况下这些钩子(hooks)是不生效的。 把这些钩子文件(hooks)的".sample"文件名后缀去掉就可以使它们生效了。 +钩子(hooks)是一些在`$GIT-DIR/hooks`目录的脚本, 在被特定的事件(certain points)触发后被调用。当`git init`命令被调用后, 一些非常有用的示例钩子脚本被拷到新仓库的hooks目录中; 但是在默认情况下它们是不生效的。 把这些钩子文件的".sample"文件名后缀去掉就可以使它们生效。 ### applypatch-msg ### GIT_DIR/hooks/applypatch-msg -当'git-am'命令执行时,这个钩子就被调用。它只有一个参数:就是存有提交消息(commit log message)的文件的名字。如果钩子的执行结果是非零,那么补丁(patch)就不会被应用(apply)。 +这个钩子是由`git am`命令调用的。它只有一个参数:就是存有将要被应用的补丁(patch)的提交消息(commit log message)的文件名。如果钩子的返回值不是`0`,那么`git am`就会放弃对补丁的应用(apply the patch)。 -The hook is allowed to edit the message file in place, and can be used to -normalize the message into some project standard format (if the project has one). -It can also be used to refuse the commit after inspecting the message file. -The default applypatch-msg hook, when enabled, runs the commit-msg hook, if the -latter is enabled. -这个钩子用于在其它地方编辑提交消息,并且可以把这些消息规范成项目的标准格式(如果项目些类的标准的话)。它也可以在分析(inspect)完消息文件后拒绝此次提交(commit)。在默认情况下,当 applypatch-msg 钩子被启用时。。。。 +这个钩子可以在工作时(译注:也就是在`git am`运行时)编辑提交(commit)信息文件(message file)。它的一个用途是把提交(commit)信息规范化,使得其符合一些项目的标准(如果有的话)。它也可以用来在分析(inspect)完消息文件后拒绝某个提交(commit)。 + + +如果默认的`applypatch-msg.sample`钩子被启用,它会调用`commit-msg`钩子(如果它也被启用的话)。 -() ### pre-applypatch ### GIT_DIR/hooks/pre-applypatch -当'git-am'命令执行时,这个钩子就被调用。它没有参数,并且是在一个补丁(patch)被应用后还未提交(commit)前被调用。如果钩子的执行结果是非零,那么刚才应用的补丁(patch)就不会被提交。 +这个钩子是由`git am`命令调用的。它不需要参数,并且是在一个补丁(patch)被应用后还未提交(commit)前被调用。如果钩子的返回值不是`0``,那么刚才应用的补丁(patch)就不会被提交。 + -It can be used to inspect the current working tree and refuse to make a commit -if it does not pass certain test. -The default pre-applypatch hook, when enabled, runs the pre-commit hook, if the -latter is enabled. +它可以用于检查当前的工作树(译注:此时补丁已经被应用但没有被提交),如果补丁不能通过测试就拒绝此次提交(commit)。 -它用于检查当前的工作树,当提交的补丁不能通过特定的测试就拒绝将它提交(commit)进仓库。 -() + +如果默认的`pre-applypatch.sample`钩子被启用,它会调用`pre-commit`钩子(如果它也被启用的话)。 ### post-applypatch ### GIT_DIR/hooks/post-applypatch -This hook is invoked by 'git-am'. It takes no parameter, -and is invoked after the patch is applied and a commit is made. -当'git-am'命令执行时,这个钩子就被调用。它没有参数,并且是在一个补丁(patch)被应用且在完成提交(commit)情况下被调用。 +这个钩子是由`git am`命令调用的。它不需要参数,并且是在一个补丁(patch)被应用且在完成提交(commit)情况下被调用。 -This hook is meant primarily for notification, and cannot affect -the outcome of 'git-am'. -这个钩子的主要用途是通知提示(notification),它并不会影响'git-am'的执行和输出。 +这个钩子主要用来通知(notification),它并不会影响`git-am`的执行结果。 ### pre-commit ### GIT_DIR/hooks/pre-commit -这个钩子被 'git-commit' 命令调用, 而且可以通过在命令中添加`\--no-verify` 参数来跳过。这个钩子没有参数,在得到提交消息和开始提交(commit)前被调用。如果钩子执行结果是非零,那么 'git-commit' 命令就会中止执行。 +这个钩子被 `git commit` 命令调用, 而且可以通过在命令中添加`\--no-verify` 参数来跳过。这个钩子不需要参数,在得到提交消息和开始提交(commit)前被调用。如果钩子返回值不是`0`,那么 `git commit` 命令就会中止执行。 -译注:此钩子可以用来在提交前检查代码错误(运行类似lint的程序)。 +译注:这个钩子可以用来在提交前检查代码错误(例如运行lint程序)。 -当默认的'pre-commit'钩子开启时,如果它发现文件尾部有空白行,那么就会中止此次提交。 +当默认的`pre-commit`钩子被启用时,如果它发现文件尾部有空白行,那么就会中止此次提交。 译注:新版的默认钩子和这里所说有所有不同。 -All the 'git-commit' hooks are invoked with the environment -variable `GIT_EDITOR=:` if the command will not bring up an editor -to modify the commit message. +如果(进行`git commit`的)命令没有制定一个编辑器来修改提交信息(commit message),任何的 `git-commit` 钩子(译注:即无论是否自带)被调用时都会带上环境变量`GIT_EDITOR=:` 下面是一个运行 Rspec 测试的 Ruby 脚本,如果没有通过这个测试,那么不允许提交(commit)。 @@ -90,33 +79,29 @@ to modify the commit message. GIT_DIR/hooks/prepare-commit-msg -当'git-commit'命令执行时:在编辑器(editor)启动前,默认提交消息准备好后,这个钩子就被调用。 +执行`git commit`命令后,在默认提交消息准备好后但编辑器(editor)启动前,这个钩子就被调用。 It takes one to three parameters. The first is the name of the file -that the commit log message. The second is the source of the commit -message, and can be: `message` (if a `-m` or `-F` option was -given); `template` (if a `-t` option was given or the -configuration option `commit.template` is set); `merge` (if the -commit is a merge or a `.git/MERGE_MSG` file exists); `squash` -(if a `.git/SQUASH_MSG` file exists); or `commit`, followed by -a commit SHA1 (if a `-c`, `-C` or `\--amend` option was given). -它有三个参数。第一个是提交消息文件的名字。第二个是提交消息的来源,它可以是:(). + +它接受一到三个参数。第一个包含了提交消息的文本文件的名字。第二个是提交消息的来源,它可以是: +* `message`(如果指定了`-m`或者`-F`选项) +* `template`(如果指定了`-t`选项,或者在设置(译注:即`git config`)中开启了`commit.template`选项) +* `merge`(如果本次提交(commit)是一次合并(merge),或者存在文件`.git/MERGE_MSG`) +* `squash`(如果存在文件`.git/SQUASH_MSG`) +* `commit` 并且第三个参数是一个提交(commit)的SHA1值(如果指定了`-c`,`-C`或者`\--amend`选项) -如果钩子的执行結果是非零的话,那么'git-commit'命令就会被中止执行。 +如果钩子的返回值不是`0`,那么`git commit`命令就会被中止执行。 -The purpose of the hook is to edit the message file in place, and -it is not suppressed by the `\--no-verify` option. A non-zero exit -means a failure of the hook and aborts the commit. It should not -be used as replacement for pre-commit hook. +这个钩子的目的是用来在工作时编辑信息文件,并且不会被`\--no-verify`选项略过。一个非`0`值意味着钩子工作失败,会终止提交(abort the commit)。它不应该用来作为`pre-commit`钩子的替代。 -The sample `prepare-commit-msg` hook that comes with git comments -out the `Conflicts:` part of a merge's commit message. +git提供的样本`prepare-commit-msg.sample`会把当前合并提交信息(a merge's commit message)中的`Conflicts:`部分注释掉。 +#Harry-Chen 校对至此# ### commit-msg ### @@ -373,4 +358,4 @@ for the user. ### 参考 ### -[Git Hooks](http://www.kernel.org/pub/software/scm/git/docs/githooks.html) * http://probablycorey.wordpress.com/2008/03/07/git-hooks-make-me-giddy/ \ No newline at end of file +[Git Hooks](http://www.kernel.org/pub/software/scm/git/docs/githooks.html) * http://probablycorey.wordpress.com/2008/03/07/git-hooks-make-me-giddy/ From c3d4a1f375c8a3830492d6a8616e15263181e0bf Mon Sep 17 00:00:00 2001 From: Michael Date: Sun, 17 Jul 2016 18:12:51 +0800 Subject: [PATCH 05/19] =?UTF-8?q?=E4=BF=AE=E6=AD=A3=E5=B7=AE=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../19_Finding_in_Git_Grep/0_ Finding_in_Git_Grep.markdown | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/text_zh/19_Finding_in_Git_Grep/0_ Finding_in_Git_Grep.markdown b/text_zh/19_Finding_in_Git_Grep/0_ Finding_in_Git_Grep.markdown index faf43ad5..3ac92e90 100644 --- a/text_zh/19_Finding_in_Git_Grep/0_ Finding_in_Git_Grep.markdown +++ b/text_zh/19_Finding_in_Git_Grep/0_ Finding_in_Git_Grep.markdown @@ -34,7 +34,7 @@ wrapper.c:89:void *xmmap(void *start, size_t length, -如果我们想只显示文件名, 我们可以使用'--name-onley'选项: +如果我们想只显示文件名, 我们可以使用'--name-only'选项: $>git grep --name-only xmmap config.c @@ -111,4 +111,4 @@ 译者注: 就是"与"条件搜索和"或"条件搜索可以组合使用. - \ No newline at end of file + From dc596df7b3902f8a2cbee62f912dd4f3f4d62029 Mon Sep 17 00:00:00 2001 From: Wang Yiding Date: Fri, 26 Aug 2016 14:48:01 +0800 Subject: [PATCH 06/19] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=B8=80=E4=BA=9B?= =?UTF-8?q?=E6=8B=BC=E5=86=99=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../0_ Distributed_Workflows_Clone_Fetch_Push.markdown | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/text_zh/11_Distributed_Workflows_Clone_Fetch_Push/0_ Distributed_Workflows_Clone_Fetch_Push.markdown b/text_zh/11_Distributed_Workflows_Clone_Fetch_Push/0_ Distributed_Workflows_Clone_Fetch_Push.markdown index f692f22e..7faf8d3a 100644 --- a/text_zh/11_Distributed_Workflows_Clone_Fetch_Push/0_ Distributed_Workflows_Clone_Fetch_Push.markdown +++ b/text_zh/11_Distributed_Workflows_Clone_Fetch_Push/0_ Distributed_Workflows_Clone_Fetch_Push.markdown @@ -1,7 +1,7 @@ ## 分布式的工作流程 ## 假设Alice现在开始了一个新项目,在/home/alice/project建了一个新的git -仓库(repository);另一个叫Bob的工作目录也在同一台机器,他要提交代码。 +仓库(repository);另外Bob的工作目录也在同一台机器,他要提交代码。 Bob 执行了这样的命令: @@ -42,7 +42,7 @@ git pull命令执行两个操作: 它从远程分支(remote branch)抓取修改 $ git remote add bob /home/bob/myrepo -这样,Alic可以用"git fetch"" 来执行"git pull"前半部分的工作, +这样,Alic可以用"git fetch"来执行"git pull"前半部分的工作, 但是这条命令并不会把抓下来的修改合并到当前分支里。 $ git fetch bob From 06599c68cae12c57546025f90a80e8417dc43baa Mon Sep 17 00:00:00 2001 From: Wang Yiding Date: Fri, 26 Aug 2016 14:49:57 +0800 Subject: [PATCH 07/19] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=B8=80=E4=BA=9B?= =?UTF-8?q?=E6=8B=BC=E5=86=99=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- text_zh/12a_Ignoring_Files/0_Ignoring_Files.markdown | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/text_zh/12a_Ignoring_Files/0_Ignoring_Files.markdown b/text_zh/12a_Ignoring_Files/0_Ignoring_Files.markdown index ab67d5b7..b7958a5b 100644 --- a/text_zh/12a_Ignoring_Files/0_Ignoring_Files.markdown +++ b/text_zh/12a_Ignoring_Files/0_Ignoring_Files.markdown @@ -24,7 +24,7 @@ 你可以点这里 linkgit:gitignore[5] 查看一下详细的语法解释. 你也可以把".gitignore" 这个文件放到工作树(working tree)里的其它目录中,这就会在它和它的子目录起忽略(ignore) -指定文件的作用。`.gitignor`文件同样可以像其它文件一样加到项目仓库里( 直接用 +指定文件的作用。`.gitignore`文件同样可以像其它文件一样加到项目仓库里( 直接用 `git add .gitignore` 和 `git commit`等命令), 这样项目里的其它开发者也能共享同一套忽略 文件规则。 From 28f7cf8392d98ac3ad3cb0f7a131f5a27542a1ab Mon Sep 17 00:00:00 2001 From: Wang Yiding Date: Fri, 26 Aug 2016 14:55:55 +0800 Subject: [PATCH 08/19] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=B8=80=E4=BA=9B?= =?UTF-8?q?=E6=8B=BC=E5=86=99=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../0_ Basic_Branching_and_Merging.markdown | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/text_zh/08_Basic_Branching_and_Merging/0_ Basic_Branching_and_Merging.markdown b/text_zh/08_Basic_Branching_and_Merging/0_ Basic_Branching_and_Merging.markdown index 45dd8072..8f698429 100644 --- a/text_zh/08_Basic_Branching_and_Merging/0_ Basic_Branching_and_Merging.markdown +++ b/text_zh/08_Basic_Branching_and_Merging/0_ Basic_Branching_and_Merging.markdown @@ -55,7 +55,7 @@ $ git branch -d experimental -git branch -d只能删除那些已经被当前分支的合并的分支. 如果你要强制删除某个分支的话就用git branch –D;下面假设你要强制删除一个叫”crazy-idea”的分支: +git branch -d只能删除那些已经被当前分支的合并的分支。如果你要强制删除某个分支的话就用git branch –D;下面假设你要强制删除一个叫“crazy-idea”的分支: $ git branch -D crazy-idea From 512e4a6e5b86d8683f5e2a98bcdfafcf43ebc3fc Mon Sep 17 00:00:00 2001 From: Peter Liu Date: Fri, 2 Feb 2018 05:35:36 +0800 Subject: [PATCH 09/19] =?UTF-8?q?Google=20=E6=8F=90=E7=A4=BA=20gitbook=20?= =?UTF-8?q?=E9=A1=B5=E9=9D=A2=E6=9C=89=E6=81=B6=E6=84=8F=E4=BB=A3=E7=A0=81?= =?UTF-8?q?=EF=BC=8C=E5=88=A0=E6=8E=89=E4=BA=86=20cnzz=20=E7=AD=89?= =?UTF-8?q?=E7=BB=9F=E8=AE=A1=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- layout/book_index_template.html | 38 +++++++-------------------------- layout/chapter_template.html | 33 ++++++---------------------- 2 files changed, 15 insertions(+), 56 deletions(-) diff --git a/layout/book_index_template.html b/layout/book_index_template.html index 466b9b13..da03dfa0 100644 --- a/layout/book_index_template.html +++ b/layout/book_index_template.html @@ -105,37 +105,15 @@

新手指南

$('.footer').corner(); }); - - - + - - - - - -
- -
- - diff --git a/layout/chapter_template.html b/layout/chapter_template.html index d97c5d29..d934613b 100644 --- a/layout/chapter_template.html +++ b/layout/chapter_template.html @@ -54,35 +54,16 @@ - - - - - - + - - - -
- -
- From 1724ed754b88346b07e2705e4f115a9336bfe3e9 Mon Sep 17 00:00:00 2001 From: Peter Liu Date: Fri, 2 Feb 2018 05:35:49 +0800 Subject: [PATCH 10/19] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E4=BA=86=20rake=20?= =?UTF-8?q?=E4=BB=BB=E5=8A=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Rakefile | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Rakefile b/Rakefile index 9d1b23b8..8a2ad478 100644 --- a/Rakefile +++ b/Rakefile @@ -1,4 +1,4 @@ -require 'script/merge' -require 'script/html' -require 'script/pdf' -require 'script/prince' \ No newline at end of file +require './script/merge' +require './script/html' +require './script/pdf' +require './script/prince' From 39e7c7151595f31588000e5579b5532318fffd7a Mon Sep 17 00:00:00 2001 From: lxylxy123456 <13691419520@163.com> Date: Sat, 8 Feb 2020 21:41:11 -0800 Subject: [PATCH 11/19] Fix markdown file problem by adding new line --- .../0_ Finding_Issues_Git_Blame.markdown | 1 + 1 file changed, 1 insertion(+) diff --git a/text_zh/28_Finding_Issues_Git_Blame/0_ Finding_Issues_Git_Blame.markdown b/text_zh/28_Finding_Issues_Git_Blame/0_ Finding_Issues_Git_Blame.markdown index 48cdeb06..2e70bf16 100644 --- a/text_zh/28_Finding_Issues_Git_Blame/0_ Finding_Issues_Git_Blame.markdown +++ b/text_zh/28_Finding_Issues_Git_Blame/0_ Finding_Issues_Git_Blame.markdown @@ -3,6 +3,7 @@ 如果你要查看文件的每个部分是谁修改的, 那么 linkgit:git-blame[1] 就是不二选择. 只要运行'git blame [filename]', 你就会得到整个文件的每一行的详细修改信息:包括SHA串,日期和作者: 译者注: Git采用SHA1做为hash签名算法, 在本书中,作者为了表达方便,常常使用SHA来代指SHA1. 如果没有特别说明, 本书中的SHA就是SHA1的代称. + $ git blame sha1_file.c ... 0fcfd160 (Linus Torvalds 2005-04-18 13:04:43 -0700 8) */ From e9e3cd85616bc238ad4184c2a63057dde4fddcc7 Mon Sep 17 00:00:00 2001 From: "Peter.Liu" Date: Thu, 2 Feb 2023 22:55:15 +0800 Subject: [PATCH 12/19] =?UTF-8?q?=E4=BF=AE=E5=A4=8Dhtml=E7=94=9F=E6=88=90?= =?UTF-8?q?=E8=84=9A=E6=9C=AC=EF=BC=8C=E8=AE=A9=E5=AE=83=E5=8F=AF=E4=BB=A5?= =?UTF-8?q?=E5=9C=A8=20Ruby=203.2=20=E4=B8=8B=E8=BF=90=E8=A1=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 由于新版的 Ruby 里的 File 类里没有 exists? 这个函数,所以写了一个 Monkey Patch --- script/html.rb | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/script/html.rb b/script/html.rb index 81293524..3545ae44 100644 --- a/script/html.rb +++ b/script/html.rb @@ -8,6 +8,13 @@ #MIN_SIZE = 1200 MIN_SIZE = 800 +# Fix for new ruby version don't have exists? function. +class File + def self.exists?(file_name) + return File.exist?(file_name) + end +end + def do_replacements(html, type = :html) # highlight code @@ -51,7 +58,7 @@ def do_replacements(html, type = :html) desc 'Create the HTML version' task :html => :merge do - if File.exists?('output/full_book.markdown') + if File.exist?('output/full_book.markdown') output = File.new('output/full_book.markdown').read output = RDiscount.new(output).to_html From 1dc0cb6f355536eed7972778cbad58710f17ada1 Mon Sep 17 00:00:00 2001 From: "Peter.Liu" Date: Fri, 3 Feb 2023 21:43:13 +0800 Subject: [PATCH 13/19] =?UTF-8?q?=E6=8A=8A=E4=BE=9D=E8=B5=96=E4=BA=86=20Ru?= =?UTF-8?q?by=20Gem=20=E5=8C=85=E6=94=BE=E5=88=B0=20Gemfile=20=E9=87=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Gemfile | 8 ++++++++ Gemfile.lock | 24 ++++++++++++++++++++++++ 2 files changed, 32 insertions(+) create mode 100644 Gemfile create mode 100644 Gemfile.lock diff --git a/Gemfile b/Gemfile new file mode 100644 index 00000000..20086696 --- /dev/null +++ b/Gemfile @@ -0,0 +1,8 @@ +# frozen_string_literal: true +ruby '3.2.0' +source "https://rubygems.org/" + +gem 'rake', '~> 13.0'# (13.0.6) +gem 'ultraviolet', '~> 1.0' +gem 'rdiscount', '~> 2.2' +gem 'builder', '~> 3.2' diff --git a/Gemfile.lock b/Gemfile.lock new file mode 100644 index 00000000..3debe478 --- /dev/null +++ b/Gemfile.lock @@ -0,0 +1,24 @@ +GEM + remote: https://rubygems.org/ + specs: + builder (3.2.4) + plist (3.6.0) + rake (13.0.6) + rdiscount (2.2.7) + textpow (1.4.0) + plist (>= 3.0.1) + ultraviolet (1.0.1) + textpow (>= 1.3.0) + +PLATFORMS + aarch64-linux + arm64-darwin-22 + +DEPENDENCIES + builder (~> 3.2) + rake (~> 13.0) + rdiscount (~> 2.2) + ultraviolet (~> 1.0) + +BUNDLED WITH + 2.4.1 From e9ad3ca06c95ca1ca973e6bf1af35a7579f8a303 Mon Sep 17 00:00:00 2001 From: "Peter.Liu" Date: Fri, 3 Feb 2023 21:43:28 +0800 Subject: [PATCH 14/19] =?UTF-8?q?=E7=94=9F=E6=88=90=E4=BA=86=E7=BC=96?= =?UTF-8?q?=E8=AF=91=E7=8E=AF=E5=A2=83=E7=9A=84=20Dockerfile?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Dockerfile | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 Dockerfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 00000000..212a93e8 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,31 @@ +FROM ubuntu + +RUN apt update + +RUN apt install git curl libssl-dev libreadline-dev zlib1g-dev autoconf bison build-essential libyaml-dev libreadline-dev libncurses5-dev libffi-dev libgdbm-dev -y + +# Install rbenv +RUN git clone https://github.com/sstephenson/rbenv.git /usr/local/rbenv +RUN echo '# rbenv setup' > /etc/profile.d/rbenv.sh +RUN echo 'export RBENV_ROOT=/usr/local/rbenv' >> /etc/profile.d/rbenv.sh +RUN echo 'export PATH="$RBENV_ROOT/bin:$PATH"' >> /etc/profile.d/rbenv.sh +RUN echo 'eval "$(rbenv init -)"' >> /etc/profile.d/rbenv.sh +RUN chmod +x /etc/profile.d/rbenv.sh + +# install ruby-build +RUN mkdir /usr/local/rbenv/plugins +RUN git clone https://github.com/sstephenson/ruby-build.git /usr/local/rbenv/plugins/ruby-build + +ENV RBENV_ROOT /usr/local/rbenv + +ENV PATH $RBENV_ROOT/bin:$RBENV_ROOT/shims:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin + +ENV RUBY_VERSION 3.2.0 +RUN rbenv install $RUBY_VERSION +RUN rbenv global $RUBY_VERSION +ENV LANG C.UTF-8 + +RUN ruby -v + +RUN gem install bundler -v '2.4.1' +RUN bundle install \ No newline at end of file From 3d4b35a48bc3db70aed6e4a4c4bcf569d0315378 Mon Sep 17 00:00:00 2001 From: "Peter.Liu" Date: Fri, 3 Feb 2023 21:43:44 +0800 Subject: [PATCH 15/19] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E4=BA=86=E4=B8=80?= =?UTF-8?q?=E4=BA=9B=E5=BF=BD=E7=95=A5=E6=96=87=E4=BB=B6=E8=A7=84=E5=88=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.gitignore b/.gitignore index c9e7c5fa..9a05ec49 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,6 @@ output/* *#* .#* *~ +.bundle +.local +.bash_history \ No newline at end of file From fabb716049b80f8baea3af9b787d2afa16c0144f Mon Sep 17 00:00:00 2001 From: "Peter.Liu" Date: Fri, 3 Feb 2023 21:54:09 +0800 Subject: [PATCH 16/19] =?UTF-8?q?=E5=B0=9D=E8=AF=95=E5=8E=BB=E6=8E=89=20Ge?= =?UTF-8?q?mfile=20=E9=87=8C=E7=9A=84=20ruby=20=E7=89=88=E6=9C=AC=E6=8C=87?= =?UTF-8?q?=E5=AE=9A=EF=BC=8C=E7=9C=8B=E8=83=BD=E5=90=A6=E9=80=9A=20cloudf?= =?UTF-8?q?lare=20pages=20=E7=9A=84=E9=83=A8=E7=BD=B2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Gemfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile b/Gemfile index 20086696..d946d0ba 100644 --- a/Gemfile +++ b/Gemfile @@ -1,5 +1,5 @@ # frozen_string_literal: true -ruby '3.2.0' +#ruby '3.2.0' source "https://rubygems.org/" gem 'rake', '~> 13.0'# (13.0.6) From 5547756bf94f5dbb484e6ba41b45ceb08ec08fc7 Mon Sep 17 00:00:00 2001 From: "Peter.Liu" Date: Sat, 4 Feb 2023 00:11:12 +0800 Subject: [PATCH 17/19] =?UTF-8?q?=E5=B0=9D=E8=AF=95=E7=94=A8=20pdfkit=20?= =?UTF-8?q?=E6=9D=A5=E7=94=9F=E6=88=90=20PDF=20=E6=96=87=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 3 ++- Gemfile | 3 +++ Rakefile | 1 + script/pdf1.rb | 24 ++++++++++++++++++++++++ 4 files changed, 30 insertions(+), 1 deletion(-) create mode 100644 script/pdf1.rb diff --git a/.gitignore b/.gitignore index 9a05ec49..93e9c046 100644 --- a/.gitignore +++ b/.gitignore @@ -4,4 +4,5 @@ output/* *~ .bundle .local -.bash_history \ No newline at end of file +.bash_history +.DS_Store \ No newline at end of file diff --git a/Gemfile b/Gemfile index d946d0ba..21ce9771 100644 --- a/Gemfile +++ b/Gemfile @@ -6,3 +6,6 @@ gem 'rake', '~> 13.0'# (13.0.6) gem 'ultraviolet', '~> 1.0' gem 'rdiscount', '~> 2.2' gem 'builder', '~> 3.2' +gem 'wkhtmltopdf-binary' +gem 'pdfkit' + diff --git a/Rakefile b/Rakefile index 8a2ad478..44d7762b 100644 --- a/Rakefile +++ b/Rakefile @@ -1,4 +1,5 @@ require './script/merge' require './script/html' require './script/pdf' +require './script/pdf1' require './script/prince' diff --git a/script/pdf1.rb b/script/pdf1.rb new file mode 100644 index 00000000..f92fed21 --- /dev/null +++ b/script/pdf1.rb @@ -0,0 +1,24 @@ +desc 'Cria um arquivo pdf à partir do html gerado' +require 'pdfkit' + +task :pdf1 => :html do + + PDFKit.configure do |config| + config.default_options = { + enable_local_file_access: true, + } + end + + html = File.new("output/index.html").read + kit = PDFKit.new(html, page_width: '235', page_height: '177.8') + kit.stylesheets << 'layout/second.css' + kit.stylesheets << 'layout/mac_classic.css' + + # Get an inline PDF + pdf = kit.to_pdf + + # Save the PDF to a file + file = kit.to_file('output/book.pdf') + + `open output/book.pdf` +end From 84b0a6cb56803a4490b5a17f85a74b3b064ab2c8 Mon Sep 17 00:00:00 2001 From: "Peter.Liu" Date: Sat, 4 Feb 2023 23:52:07 +0800 Subject: [PATCH 18/19] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E4=BA=86=E6=96=B0?= =?UTF-8?q?=E7=9A=84=E4=B8=AD=E6=96=87=20README.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 README.md diff --git a/README.md b/README.md new file mode 100644 index 00000000..4c484b81 --- /dev/null +++ b/README.md @@ -0,0 +1,22 @@ +# Git Community Book 中译本 + +图书在线阅读网址:https://gitbook.lkiuhui998.com + +原始仓库地址:https://github.com/schacon/gitbook + +作者: + +* Scott Chacon +* Emil Sit + +译者: + +* [Peter Liu](http://liuhui998.com) +* [Liu Wei](http://blog.liuw.name) + +* [Wendal](http://wendal.net) +* [Jiancong Guo](http://www.cbpm-gw.com) + + + + From 20109c5273f0be1db5d0bf4dcb3ec506a41c8ffa Mon Sep 17 00:00:00 2001 From: "Peter.Liu" Date: Sat, 4 Feb 2023 23:55:23 +0800 Subject: [PATCH 19/19] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E4=BA=86=E5=8E=9F?= =?UTF-8?q?=E5=A7=8B=E4=BD=9C=E8=80=85=20blog=20=E7=9A=84=20link?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 4c484b81..282d1b07 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,8 @@ 作者: -* Scott Chacon +* [Scott Chacon](https://scottchacon.com/) + * Emil Sit 译者: