Skip to content

Commit 4ca2118

Browse files
committed
Merge pull request #33 from YueLinHo/3.3
翻譯 第三章 第三節 分支管理 PART 2
2 parents 1400308 + 892381e commit 4ca2118

File tree

2 files changed

+15
-15
lines changed

2 files changed

+15
-15
lines changed

book/03-git-branching/sections/branch-management.asc

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22
=== 分支管理
33

44
(((branches, managing)))
5-
Now that you've created, merged, and deleted some branches, let's look at some branch-management tools that will come in handy when you begin using branches all the time.
5+
到目前為止,你已經建立、合併和刪除過分支(branch);讓我們再來看一些分支管理工具,這將會在你開始全程使用分支時派上用場。
66

7-
The `git branch` command does more than just create and delete branches.(((git commands, branch)))
8-
If you run it with no arguments, you get a simple listing of your current branches:
7+
`git branch` 命令不僅能建立和刪除分支,(((git commands, branch)))
8+
如果不加任何參數,你將會得到所有分支的簡易清單:
99

1010
[source,console]
1111
----
@@ -15,9 +15,9 @@ $ git branch
1515
testing
1616
----
1717

18-
Notice the `*` character that prefixes the `master` branch: it indicates the branch that you currently have checked out (i.e., the branch that `HEAD` points to).
19-
This means that if you commit at this point, the `master` branch will be moved forward with your new work.
20-
To see the last commit on each branch, you can run `git branch -v`:
18+
注意 `master` 分支前面的 `*` 字元,它表示目前所檢出(checkout)的分支(換句話說,`HEAD` 指向這個分支);
19+
這意味著如果你現在提交,`master` 分支將隨之向前移動。
20+
若要查看各個分支最後一個提交,執行 `git branch -v`
2121

2222
[source,console]
2323
----
@@ -27,8 +27,8 @@ $ git branch -v
2727
testing 782fd34 add scott to the author list in the readmes
2828
----
2929

30-
The useful `--merged` and `--no-merged` options can filter this list to branches that you have or have not yet merged into the branch you're currently on.
31-
To see which branches are already merged into the branch you're on, you can run `git branch --merged`:
30+
`--merged` `--no-merged` 這兩個有用的選項,可以從該清單中篩選出已經合併或尚未合併到目前分支的分支。
31+
使用 `git branch --merged` 來查看哪些分支已被合併到目前分支:
3232

3333
[source,console]
3434
----
@@ -37,19 +37,19 @@ $ git branch --merged
3737
* master
3838
----
3939

40-
Because you already merged in `iss53` earlier, you see it in your list.
41-
Branches on this list without the `*` in front of them are generally fine to delete with `git branch -d`; you've already incorporated their work into another branch, so you're not going to lose anything.
40+
由於之前的 `iss53` 已經被合併了,所以會在列表中看到它;
41+
在這個列表中沒有被標記 `*` 的分支通常都可以用 `git branch -d` 刪除;你已經把它們的工作內容整併到其他分支,所以刪掉它們也不會有所損失。
4242

43-
To see all the branches that contain work you haven't yet merged in, you can run `git branch --no-merged`:
43+
查看所有包含未合併工作的分支,可以運行 `git branch --no-merged`
4444

4545
[source,console]
4646
----
4747
$ git branch --no-merged
4848
testing
4949
----
5050

51-
This shows your other branch.
52-
Because it contains work that isn't merged in yet, trying to delete it with `git branch -d` will fail:
51+
這顯示了你其它的分支;
52+
由於它包含了還未合併的工作,嘗試使用 `git branch -d` 刪除該分支將會失敗:
5353

5454
[source,console]
5555
----
@@ -58,4 +58,4 @@ error: The branch 'testing' is not fully merged.
5858
If you are sure you want to delete it, run 'git branch -D testing'.
5959
----
6060

61-
If you really do want to delete the branch and lose that work, you can force it with `-D`, as the helpful message points out.
61+
如果你確實想要刪除該分支並丟掉那個工作成果,可以用 `-D` 選項來強制執行,就像上面訊息中所提示的。

status.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
"03-git-branching": {
2727
"1-git-branching.asc": 100,
2828
"sections/basic-branching-and-merging.asc": 100,
29-
"sections/branch-management.asc": 1,
29+
"sections/branch-management.asc": 100,
3030
"sections/nutshell.asc": 100,
3131
"sections/rebasing.asc": 1,
3232
"sections/remote-branches.asc": 1,

0 commit comments

Comments
 (0)