-
Notifications
You must be signed in to change notification settings - Fork 37
翻譯 第三章 第三節 分支管理 #30
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
翻譯 第三章 第三節 分支管理 #30
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,10 +2,10 @@ | |
=== 分支管理 | ||
|
||
(((branches, managing))) | ||
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. | ||
到目前為止,你已經建立過、合併過和刪除過分支(branch);讓我們再來看一些分支管理工具,隨著你不斷地使用分支功能,它們會讓你工作得更順手。 | ||
|
||
The `git branch` command does more than just create and delete branches.(((git commands, branch))) | ||
If you run it with no arguments, you get a simple listing of your current branches: | ||
`git branch` 命令不僅能建立和刪除分支,(((git commands, branch))) | ||
如果不加任何參數,你會得到一份簡單的列表列出目前所有分支: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 「你會得到一份簡單的列表列出目前所有分支」→「你將會得到所有分支的簡易清單」 |
||
|
||
[source,console] | ||
---- | ||
|
@@ -15,9 +15,9 @@ $ git branch | |
testing | ||
---- | ||
|
||
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). | ||
This means that if you commit at this point, the `master` branch will be moved forward with your new work. | ||
To see the last commit on each branch, you can run `git branch -v`: | ||
注意 `master` 分支前面有一個 `*` 字元,它表示目前所檢出(checkout)的分支(換句話說,`HEAD` 指向這個分支); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 「分支前面有一個 |
||
這意謂著如果你現在提交,`master` 分支將隨著向前移動。 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 「意謂」→「意味」 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
如果是「意謂著」,要用「謂」 |
||
若要查看各個分支最後一個提交資訊,執行 `git branch -v`: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 「最後一個提交資訊」→「最後一個提交」 |
||
|
||
[source,console] | ||
---- | ||
|
@@ -27,8 +27,8 @@ $ git branch -v | |
testing 782fd34 add scott to the author list in the readmes | ||
---- | ||
|
||
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. | ||
To see which branches are already merged into the branch you're on, you can run `git branch --merged`: | ||
要從該清單中篩選出「已經」或「尚未」與目前分支合併的分支,分別可以用 `--merged` 和 `--no-merged` 選項。 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
使用 `git branch --merged` 來查看哪些分支已被合併到目前分支: | ||
|
||
[source,console] | ||
---- | ||
|
@@ -37,19 +37,19 @@ $ git branch --merged | |
* master | ||
---- | ||
|
||
Because you already merged in `iss53` earlier, you see it in your list. | ||
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. | ||
由於之前的 `iss53` 已經被合併了,所以會在列表中看到它; | ||
列表中沒有被標記 `*` 的分支通常都可以用 `git branch -d` 刪除;你已經把它們的工作內容整併到其他分支,所以刪掉它們也不會有所損失。 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 「列表中沒有被標記 |
||
|
||
To see all the branches that contain work you haven't yet merged in, you can run `git branch --no-merged`: | ||
使用 `git branch --no-merged` 來查看哪些分支的工作尚未被合併: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 查看所有包含未合併工作的分支,可以運行 |
||
|
||
[source,console] | ||
---- | ||
$ git branch --no-merged | ||
testing | ||
---- | ||
|
||
This shows your other branch. | ||
Because it contains work that isn't merged in yet, trying to delete it with `git branch -d` will fail: | ||
這顯示了你其它的分支; | ||
由於它包含了尚未被合併進來的工作內容,用 `git branch -d` 刪除該分支將會失敗: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 「尚未被合併進來的工作內容」→「還未合併的工作」 |
||
|
||
[source,console] | ||
---- | ||
|
@@ -58,4 +58,4 @@ error: The branch 'testing' is not fully merged. | |
If you are sure you want to delete it, run 'git branch -D testing'. | ||
---- | ||
|
||
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. | ||
如果你確實想要刪除該分支並丟掉那個工作成果,可以用 `-D` 選項(譯註:大寫的 D)來強制執行,就像上面訊息中所提示的。 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 感覺這裡的譯註不太需要 |
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
「你已經建立過、合併過和刪除過分支」→「你已經建立、合併和刪除過分支」
「隨著你不斷地使用分支功能,它們會讓你工作得更順手」→「這將會在你開始全程使用分支時派上用場」