Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions C-git-commands.asc
Original file line number Diff line number Diff line change
Expand Up @@ -156,13 +156,13 @@ Git 做的很多工作都有一种默认方式。

首先,我们在 <<ch02-git-basics-chapter#_git_diff_staged>> 一章中研究了 `git diff` 的基本用法,在此节中我们展示了如何查看哪些变化已经暂存了,哪些没有。

在 <<ch05-distributed-git#_commit_guidelines>> 一节中,我们在提交前使用 `--check` 选项来检查可能存在的空白字符问题。
在 <<ch05-distributed-git#_commit_guidelines>> 一节中,我们在提交前使用 `--check` 选项来检查可能存在的空白字符问题。

在 <<ch05-distributed-git#_what_is_introduced>> 一节中,了解了使用 `git diff A...B` 语法来更有效地比较不同分支之间的差异。
在 <<ch05-distributed-git#_what_is_introduced>> 一节中,了解了使用 `git diff A...B` 语法来更有效地比较不同分支之间的差异。

在 <<ch07-git-tools#_advanced_merging>> 一节中我们使用 `-b` 选项来过滤掉空白字符的差异,及通过 `--theirs`、`--ours` 和 `--base` 选项来比较不同暂存区冲突文件的差异。

最后,在 <<ch07-git-tools#_starting_submodules>> 一节中,我们使用此命令合 `--submodule` 选项来有效地比较子模块的变化。
最后,在 <<ch07-git-tools#_starting_submodules>> 一节中,我们使用此命令配合 `--submodule` 选项来有效地比较子模块的变化。

==== git difftool

Expand Down Expand Up @@ -451,7 +451,7 @@ Git 中的一些命令是以引入的变更即提交这样的概念为中心的

==== git rebase

`git rebase` 命令基本是是一个自动化的 `cherry-pick` 命令。
`git rebase` 命令基本是一个自动化的 `cherry-pick` 命令。
它计算出一系列的提交,然后再以它们在其他地方以同样的顺序一个一个的 `cherry-picks` 出它们。

在 <<ch03-git-branching#_rebasing>> 一章中详细提到了此命令,包括与已经公开的分支的变基所涉及的协作问题。
Expand Down
2 changes: 1 addition & 1 deletion book/10-git-internals/sections/maintenance.asc
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ fdf4fc3344e67ab068f836878b6c4951e3b15f3d first commit
当你正在工作时,Git 会默默地记录每一次你改变 HEAD 时它的值。
每一次你提交或改变分支,引用日志都会被更新。
引用日志(reflog)也可以通过 `git update-ref` 命令更新,我们在
<<ch10-git-internals#_git_refs>> 有提到使用这个命令而不是是直接将 SHA-1 的值写入引用文件中的原因。
<<ch10-git-internals#_git_refs>> 有提到使用这个命令而不是直接将 SHA-1 的值写入引用文件中的原因。
你可以在任何时候通过执行 `git reflog` 命令来了解你曾经做过什么:

[source,console]
Expand Down
2 changes: 1 addition & 1 deletion book/B-embedding-git/sections/dulwich.asc
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
(((Dulwich)))(((Python)))
这还有一个纯-Python 的 Git 实现——Dulwich。
该项目托管在 https://www.dulwich.io/[]。
它旨在在提供一个与 Git 存储库(本地和远程)的接口,该接口不直接调用 git,而是使用纯 Python。
它旨在提供一个与 Git 存储库(本地和远程)的接口,该接口不直接调用 git,而是使用纯 Python。
它有一个可选的 C 扩展,可以显著提高性能。

Dulwich 遵循 git 设计,将 API 分为两个基本级别:底层命令和上层命令。
Expand Down
4 changes: 2 additions & 2 deletions book/B-embedding-git/sections/jgit.asc
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ java -cp .:org.eclipse.jgit-3.5.0.201409260305-r.jar App
==== 底层命令

JGit 的 API 有两种基本的层次:底层命令和高层命令。
这个两个术语都来自 Git ,并且 JGit 也被按照相同的方式粗略地划分:高层 API 是一个面向普通用户级别功能的友好的前端(一系列普通用户使用 Git 命令行工具时可能用到的东西),底层 API 则直接作用于低级的仓库对象。
这两个术语都来自 Git ,并且 JGit 也被按照相同的方式粗略地划分:高层 API 是一个面向普通用户级别功能的友好的前端(一系列普通用户使用 Git 命令行工具时可能用到的东西),底层 API 则直接作用于低级的仓库对象。

大多数 JGit 会话会以 `Repository` 类作为起点,你首先要做的事就是创建一个它的实例。
对于一个基于文件系统的仓库来说(嗯, JGit 允许其它的存储模型),用 `FileRepositoryBuilder` 完成它。
Expand Down Expand Up @@ -156,5 +156,5 @@ for (Ref ref : remoteRefs) {
如果你对这有兴趣并且想深入学习,在下面可以找到一些信息和灵感。

* JGit API 在线官方文档: https://www.eclipse.org/jgit/documentation[] 。
这是基本的 Javadoc ,所以你也可以在你最喜欢的 JVM IDE 上将它们安装它们到本地。
这是基本的 Javadoc ,所以你也可以在你最喜欢的 JVM IDE 上将它们安装到本地。
* JGit Cookbook : https://github.com/centic9/jgit-cookbook[] 拥有许多如何利用 JGit 实现特定任务的例子。