Skip to content

Commit

Permalink
Merge branch 'progit:master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
ousugo authored Dec 21, 2024
2 parents 0c9152a + 72233a6 commit 1ab75ba
Show file tree
Hide file tree
Showing 57 changed files with 382 additions and 1,216 deletions.
8 changes: 4 additions & 4 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ assignees: ''
<!-- Before filing a bug please check the following: -->
<!-- * There's no existing/similar bug report. -->
<!-- * This bug report is about a single actionable bug. -->
<!-- * This bug is about the Pro Git book, version 2, English language. -->
<!-- * This bug is about the book as found on the [website](https://www.git-scm.com/book/en/v2) or the pdf. -->
<!-- * If you found a issue in the pdf/epub/mobi files, you've checked if the problem is also present in the Pro Git book on the [website](https://www.git-scm.com/book/en/v2). -->
<!-- * This bug is **not** about a translation, if so please file a bug with the translation project. You can find a table of translation projects here: [progit2/TRANSLATING.md](https://github.com/progit/progit2/blob/master/TRANSLATING.md) -->
<!-- * This bug is about the Pro Git book, version 2, Chinese language. -->
<!-- * This bug is about the book as found on the [website](https://www.git-scm.com/book/zh/v2) or the pdf. -->
<!-- * If you found a issue in the pdf/epub/mobi files, you've checked if the problem is also present in the Pro Git book on the [website](https://www.git-scm.com/book/zh/v2). -->
<!-- * This bug is about Chinese translation. You can find a table of translation projects here: [progit2/TRANSLATING.md](https://github.com/progit/progit2/blob/master/TRANSLATING.md) -->
<!-- * This bug is **not** about the git-scm.com site, if so please file a bug here: [git-scm.com/issues/new](https://github.com/git/git-scm.com/issues/new) -->
<!-- * This bug is **not** about git the program itself, if so please file a bug here: [git-scm.com/community](https://git-scm.com/community) -->
<!-- * This bug is **not** about Git for Windows, if so please file a bug here: [git-for-windows/git](https://github.com/git-for-windows/git). -->
Expand Down
8 changes: 2 additions & 6 deletions .github/workflows/pr-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,13 @@ jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4

- 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:
ruby-version: 2.7
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
14 changes: 5 additions & 9 deletions .github/workflows/release-on-merge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,21 +8,17 @@ 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: |
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
Expand All @@ -31,12 +27,12 @@ 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

- name: Create release
uses: ncipollo/release-action@v1
with:
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'
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ progit.html
progit.pdf
progit.pdfmarks
progit.epub
progit.fb2.zip
progit-kf8.epub
progit.mobi
contributors.txt
2 changes: 0 additions & 2 deletions A-git-in-other-environments.asc
Original file line number Diff line number Diff line change
Expand Up @@ -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[]
Expand Down
47 changes: 22 additions & 25 deletions C-git-commands.asc
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
[appendix]
== Git 命令

在这一整本书里我们介绍了大量的 Git 命令,并尽可能的通过讲故事的的方式来介绍它们,慢慢的介绍了越来越多的命令
但是这导致这些命令的示例用法都散落在在全书的各处
在这一整本书里我们介绍了大量的 Git 命令,并尽可能通过讲故事的方式来介绍它们,慢慢介绍了越来越多的命令
但是这导致这些命令的示例用法都散落在全书的各处

在此附录中,我们会将本书中所提到过的命令都过一遍,并根据其用途大致的分类
我们会大致地讨论每个命的作用,指出其在本书中哪些章节使用过。
在此附录中,我们会将本书中所提到过的命令都过一遍,并根据其用途进行大致分类
我们会大致地讨论每个命令的作用,指出其在本书中哪些章节使用过。

[TIP]
====
Expand All @@ -18,8 +18,7 @@

=== 设置与配置

有两个十分常用的命令:`config` 和 `help`。
从第一次调用 Git 到日常微调及阅读参考,它们一直陪伴着你。
有两个十分常用的命令:`config` 和 `help`。从第一次调用 Git 到日常微调及阅读参考,它们一直陪伴着你。

==== git config

Expand All @@ -42,7 +41,7 @@ Git 做的很多工作都有一种默认方式。

最后,基本上 <<ch08-customizing-git#_git_config>> 整个章节都是针对此命令的。

[[_core_editor]]
[[ch_core_editor]]
==== git config core.editor 命令

就像 <<ch01-getting-started#_first_time>> 里的设置指示,很多编辑器可以如下设置:
Expand All @@ -52,23 +51,26 @@ 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"`
|WordPad |`git config --global core.editor '"C:\Program Files\Windows NT\Accessories\wordpad.exe"'"`
|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"`
|==============================

Expand All @@ -84,7 +86,6 @@ Git 做的很多工作都有一种默认方式。

我们在 <<ch01-getting-started#_git_help>> 一节中介绍了 `git help` 命令,同时在 <<ch04-git-on-the-server#_setting_up_server>> 一节中给你展示了如何使用它来查找更多关于 `git shell` 的信息。


=== 获取与创建项目

有几种方式获取一个 Git 仓库。
Expand Down Expand Up @@ -119,7 +120,6 @@ Git 做的很多工作都有一种默认方式。

虽然在本书的其他地方都有用到此命令,但是上面这些用法是特例,或者使用方式有点特别。


=== 快照基础

对于基本的暂存内容及提交到你的历史记录中的工作流,只有少数基本的命令。
Expand Down Expand Up @@ -312,7 +312,6 @@ Git 有几个实现大部的分支及合并功能的实用命令。

我也在 <<ch07-git-tools#_signing>> 一节中介绍了如何使用 `-s` 标志创建一个 GPG 签名的标签,然后使用 `-v` 选项来验证。


=== 项目分享与更新

在 Git 中没有多少访问网络的命令,几乎所以的命令都是在操作本地的数据库。
Expand Down Expand Up @@ -414,7 +413,6 @@ Git 有几个实现大部的分支及合并功能的实用命令。

我们在 <<ch05-distributed-git#_build_number>> 及 <<ch05-distributed-git#_preparing_release>> 章节中使用 `git describe` 命令来获得一个字符串来命名我们发布的文件。


=== 调试

Git 有一些命令可以用来帮你调试你代码中的问题。
Expand Down Expand Up @@ -496,14 +494,14 @@ Git 中的一些命令是以引入的变更即提交这样的概念为中心的

==== git format-patch


`git format-patch` 命令用来以 mbox 的格式来生成一系列的补丁以便你可以发送到一个邮件列表中。

我们在 <<ch05-distributed-git#_project_over_email>> 一节中研究了一个使用 `git format-patch` 工具为一个项目做贡献的示例。


==== git imap-send

`git imap-send` 将一个由 `git format-patch` 生成的邮箱上传至 IMAP 草稿文件夹。

我们在 <<ch05-distributed-git#_project_over_email>> 一节中见过一个通过使用 `git imap-send` 工具向一个项目发送补丁进行贡献的例子。

==== git send-email
Expand Down Expand Up @@ -549,7 +547,6 @@ Git 有一些可以与其他的版本控制系统集成的命令。

==== git fsck


`git fsck` 命令用来检查内部数据库的问题或者不一致性。

我们只在 <<ch10-git-internals#_data_recovery>> 这一节中快速使用了一次此命令来搜索所有的悬空对象(dangling object)。
Expand All @@ -568,7 +565,7 @@ Git 有一些可以与其他的版本控制系统集成的命令。

在 <<ch07-git-tools#_removing_file_every_commit>> 一节中,我们解释了此命令,并探究了其他几个选项,例如 `--commit-filter`,`--subdirectory-filter` 及 `--tree-filter` 。

在 <<ch09-git-and-other-systems#_git_p4>> 和 <<ch09-git-and-other-systems#_git_tfs>> 的章节中我们使用它来修复已经导入的外部仓库。
在 <<ch09-git-and-other-systems#_git_p4>> 的章节中我们使用它来修复已经导入的外部仓库。

=== 底层命令

Expand Down
15 changes: 8 additions & 7 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -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 'asciidoctor-epub3', '1.5.0.alpha.9'
gem 'ttfunk', '1.5.1'
gem 'asciidoctor-fb2'
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', '~> 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'
27 changes: 27 additions & 0 deletions README.asc
Original file line number Diff line number Diff line change
Expand Up @@ -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 跟踪系统中搜索是否已有类似的问题。
Expand Down
Loading

0 comments on commit 1ab75ba

Please sign in to comment.