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
2 changes: 1 addition & 1 deletion book/02-git-basics/sections/remotes.asc
Original file line number Diff line number Diff line change
Expand Up @@ -231,4 +231,4 @@ $ git remote
origin
----

Once you delete the reference to a remote this way, all remote-tracking branches and configuration settings associated with that remote are also deleted.
一旦你使用这种方式删除了一个远程仓库,那么所有和这个远程仓库相关的远程跟踪分支以及配置信息也会一起被删除。
18 changes: 9 additions & 9 deletions book/05-distributed-git/sections/contributing.asc
Original file line number Diff line number Diff line change
Expand Up @@ -150,10 +150,10 @@ To jessica@githost:simplegit.git
1edee6b..fbff5bc master -> master
----

The last line of the output above shows a useful return message from the push operation.
The basic format is `<oldref>..<newref> fromref -> toref`, where `oldref` means the old reference, `newref` means the new reference, `fromref` is the name of the local reference being pushed, and `toref` is the name of the remote reference being updated.
You'll see similar output like this below in the discussions, so having a basic idea of the meaning will help in understanding the various states of the repositories.
More details are available in the documentation for https://git-scm.com/docs/git-push[git-push].
上方输出信息中最后一行显示的是推送操作执行完毕后返回的一条很有用的消息。
消息的基本格式是`<oldref>..<newref> fromref -> toref``oldref`的含义是推送前所指向的引用,`newref`的含义是推送后所指向的引用,`fromref`是将要被推送的本地引用的名字,`toref`是将要被更新的远程引用的名字。
在后面的讨论中你还会看到类似的输出消息,所以对这条消息的含义有一些基础的了解将会帮助你理解仓库的诸多状态。
想要了解更多细节请访问文档 https://git-scm.com/docs/git-push[git-push]

John 稍候也做了些改动,将它们提交到了本地仓库中,然后试着将它们推送到同一个服务器:

Expand Down Expand Up @@ -241,7 +241,7 @@ Jessica 的历史现在看起来像这样:
.抓取 John 的改动后 Jessica 的历史
image::images/small-team-5.png[抓取 John 的改动后 Jessica 的历史。]

Jessica 认为她的主题分支已经准备好了,但她像知道需要将 John 工作的哪些合并到自己的工作中才能推送。
Jessica 认为她的主题分支已经准备好了,但她想知道需要将 John 工作的哪些合并到自己的工作中才能推送。
她运行 `git log` 找了出来:

[source,console]
Expand All @@ -259,7 +259,7 @@ Date: Fri May 29 16:01:27 2009 -0700
我们将会在 <<ch07-git-tools#_commit_ranges>> 中详细介绍这个语法。

目前,我们可以从输出中看到有一个 John 生成的但是 Jessica 还没有合并的提交。
如果她合并 `origin/master`,也就是说将会修改她的本地工作的那个单个提交
如果她合并 `origin/master`,那个未合并的提交将会修改她的本地工作

现在,Jessica 可以合并她的特性工作到她的 master 分支,
合并 John 的工作(`origin/master`)进入她的 `master` 分支,然后再次推送回服务器。
Expand Down Expand Up @@ -289,7 +289,7 @@ Fast forward
----

没有发生问题,如你所见它是一次简单的快进合并。
现在 Jessica 在本地合并了 `origin/master` 分支上 John 之前抓取的工作
现在 Jessica 在本地合并了之前抓取的 `origin/master` 分支上 John 的工作

[source,console]
----
Expand Down Expand Up @@ -549,7 +549,7 @@ $ git remote add myfork <url>
(拣选操作 `cherry-pick` 详见 <<ch05-distributed-git#_rebase_cherry_pick>>)。
如果维护者合并、变基或拣选你的工作,不管怎样你最终会通过拉取他们的仓库找回来你的工作。

In any event, you can push your work with:
在任何情况下,你都可以使用下面的命令推送你的工作:

[source,console]
----
Expand All @@ -560,7 +560,7 @@ $ git push -u myfork featureA
当工作已经被推送到你的派生仓库后,你需要通知原项目的维护者你有想要他们合并的工作。
这通常被称作一个 *拉取请求(Pull Request)*,你通常可以通过网站生成它——
GitHub 有它自己的 Pull Request 机制,我们将会在 <<ch06-github#ch06-github>>
介绍——也可以运行 `git request-pull` 命令然后手动地将输出发送电子邮件给项目的维护者
介绍——也可以运行 `git request-pull` 命令然后将随后的输出通过电子邮件手动发送给项目维护者

`git request-pull` 命令接受一个要拉取主题分支的基础分支,以及它们要拉取的 Git 仓库的 URL,
产生一个请求拉取的所有修改的摘要。
Expand Down
2 changes: 1 addition & 1 deletion book/10-git-internals/sections/objects.asc
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@ fdf4fc3344e67ab068f836878b6c4951e3b15f3d
----

由于创建时间和作者数据不同,你现在会得到一个不同的散列值。
请将本章后续内容中的提交和标签的散列值替换会你自己的校验和
请将本章后续内容中的提交和标签的散列值替换为你自己的校验和
现在可以通过 `git cat-file` 命令查看这个新提交对象:

[source,console]
Expand Down
13 changes: 8 additions & 5 deletions book/contributors.asc
Original file line number Diff line number Diff line change
Expand Up @@ -103,11 +103,14 @@ include::contributors.txt[]
A1. 其它环境中的 Git, ,
A1.1 图形界面, https://github.com/hbrls[@hbrls], https://github.com/IceNature[@IceNature]
A1.2 Visual Studio 中的 Git, https://github.com/liwenzhuo[@liwenzhuo], https://github.com/devbean[@devbean] https://github.com/IceNature[@IceNature] https://github.com/Geno1024[@Geno1024]
A1.3 Eclipse 中的 Git, https://github.com/WispZhan[@WispZhan], https://github.com/IceNature[@IceNature] https://github.com/Geno1024[@Geno1024] https://github.com/sanddudu[许伟程]
A1.4 Bash 中的 Git, https://github.com/WispZhan[@WispZhan], https://github.com/IceNature[@IceNature] https://github.com/Geno1024[@Geno1024] https://github.com/neo1218[@neo1218]
A1.5 Zsh 中的 Git, https://github.com/branchzero[@branchzero], https://github.com/IceNature[@IceNature] https://github.com/Geno1024[@Geno1024] https://github.com/polarlights[@polarlights]
A1.6 Powershell 中的 Git, https://github.com/branchzero[@branchzero], https://github.com/IceNature[@IceNature] https://github.com/Geno1024[@Geno1024] https://github.com/sanddudu[许伟程]
A1.7 总结, https://github.com/networm[@networm], https://github.com/IceNature[@IceNature] https://github.com/Geno1024[@Geno1024] https://github.com/sanddudu[许伟程]
A1.3 Visual Studio Code 中的 Git, https://github.com/ousugo[@Asurada], https://github.com/networm[@networm]
A1.4 Eclipse 中的 Git, https://github.com/WispZhan[@WispZhan], https://github.com/IceNature[@IceNature] https://github.com/Geno1024[@Geno1024] https://github.com/sanddudu[许伟程]
A1.5 IntelliJ / PyCharm / WebStorm / PhpStorm / RubyMine 中的 Git, https://github.com/ousugo[@Asurada], https://github.com/networm[@networm]
A1.6 Sublime Text 中的 Git, https://github.com/ousugo[@Asurada], https://github.com/networm[@networm]
A1.7 Bash 中的 Git, https://github.com/WispZhan[@WispZhan], https://github.com/IceNature[@IceNature] https://github.com/Geno1024[@Geno1024] https://github.com/neo1218[@neo1218]
A1.8 Zsh 中的 Git, https://github.com/branchzero[@branchzero], https://github.com/IceNature[@IceNature] https://github.com/Geno1024[@Geno1024] https://github.com/polarlights[@polarlights]
A1.9 Powershell 中的 Git, https://github.com/branchzero[@branchzero], https://github.com/IceNature[@IceNature] https://github.com/Geno1024[@Geno1024] https://github.com/sanddudu[许伟程]
A1.10 总结, https://github.com/networm[@networm], https://github.com/IceNature[@IceNature] https://github.com/Geno1024[@Geno1024] https://github.com/sanddudu[许伟程]
A2. 将 Git 嵌入你的应用, ,
A2.1 命令行 Git 方式, https://github.com/Geno1024[@Geno1024],
A2.2 Libgit2, https://github.com/Geno1024[@Geno1024], https://github.com/IceNature[@IceNature] https://github.com/fatjyc[@fatjyc] https://github.com/branchzero[@branchzero]
Expand Down