Skip to content

Commit

Permalink
Merge branch 'book-zh-tw' of bundle-zh-tw/zh-tw.bundle into hugo
Browse files Browse the repository at this point in the history
  • Loading branch information
dscho committed Nov 18, 2023
2 parents d166aef + a22ed99 commit a246ddf
Show file tree
Hide file tree
Showing 652 changed files with 2,215 additions and 451 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ <h4 id="r_enforcing_commit_message_format">Enforcing a Specific Commit-Message F
<div class="paragraph">
<p>You have to figure out how to get the commit message from each of these commits to test.
To get the raw commit data, you can use another plumbing command called <code>git cat-file</code>.
We’ll go over all these plumbing commands in detail in <a href="ch00/ch10-git-internals">[ch10-git-internals]</a>; but for now, here’s what that command gives you:</p>
We’ll go over all these plumbing commands in detail in <a href="{{< relurl "book/zh-tw/v2/ch00/ch10-git-internals" >}}">[ch10-git-internals]</a>; but for now, here’s what that command gives you:</p>
</div>
<div class="listingblock">
<div class="content">
Expand Down Expand Up @@ -213,7 +213,7 @@ <h4 id="_enforcing_a_user_based_acl_system">Enforcing a User-Based ACL System</h
</div>
<div class="paragraph">
<p>You can pretty easily see what files have been modified in a single commit with the <code>--name-only</code> option to the <code>git log</code> command
(mentioned briefly in <a href="ch00/ch02-git-basics">[ch02-git-basics]</a>):</p>
(mentioned briefly in <a href="{{< relurl "book/zh-tw/v2/ch00/ch02-git-basics" >}}">[ch02-git-basics]</a>):</p>
</div>
<div class="listingblock">
<div class="content">
Expand Down Expand Up @@ -503,7 +503,7 @@ <h3 id="_client_side_hooks_2">Client-Side Hooks</h3>
</div>
</div>
<div class="paragraph">
<p>This script uses a syntax that wasn’t covered in <a href="ch00/r_revision_selection">Revision Selection</a>. You get a list of commits that have already been pushed up by running this:</p>
<p>This script uses a syntax that wasn’t covered in <a href="{{< relurl "book/zh-tw/v2/ch00/r_revision_selection" >}}">Revision Selection</a>. You get a list of commits that have already been pushed up by running this:</p>
</div>
<div class="listingblock">
<div class="content">
Expand Down
6 changes: 3 additions & 3 deletions content/book/zh-tw/v2/Customizing-Git-Git-Attributes.html
Original file line number Diff line number Diff line change
Expand Up @@ -238,18 +238,18 @@ <h3 id="r_keyword_expansion">Keyword Expansion</h3>
<div class="paragraph">
<p>It turns out that you can write your own filters for doing substitutions in files on commit/checkout.
These are called “clean” and “smudge” filters.
In the <code>.gitattributes</code> file, you can set a filter for particular paths and then set up scripts that will process files just before they’re checked out (“smudge”, see <a href="ch00/rfilters_a">The “smudge” filter is run on checkout.</a>) and just before they’re staged (“clean”, see <a href="ch00/rfilters_b">The “clean” filter is run when files are staged.</a>).
In the <code>.gitattributes</code> file, you can set a filter for particular paths and then set up scripts that will process files just before they’re checked out (“smudge”, see <a href="{{< relurl "book/zh-tw/v2/ch00/rfilters_a" >}}">The “smudge” filter is run on checkout.</a>) and just before they’re staged (“clean”, see <a href="{{< relurl "book/zh-tw/v2/ch00/rfilters_b" >}}">The “clean” filter is run when files are staged.</a>).
These filters can be set to do all sorts of fun things.</p>
</div>
<div id="rfilters_a" class="imageblock">
<div class="content">
<img src="{{< relurl "book/en/v2/images/smudge.png" >}}" alt="The ``smudge'' filter is run on checkout.">
<img src="{{< relurl "book/zh-tw/v2/images/smudge.png" >}}" alt="The ``smudge'' filter is run on checkout.">
</div>
<div class="title">圖表 143. The “smudge” filter is run on checkout.</div>
</div>
<div id="rfilters_b" class="imageblock">
<div class="content">
<img src="{{< relurl "book/en/v2/images/clean.png" >}}" alt="The ``clean'' filter is run when files are staged.">
<img src="{{< relurl "book/zh-tw/v2/images/clean.png" >}}" alt="The ``clean'' filter is run when files are staged.">
</div>
<div class="title">圖表 144. The “clean” filter is run when files are staged.</div>
</div>
Expand Down
10 changes: 5 additions & 5 deletions content/book/zh-tw/v2/Customizing-Git-Git-Configuration.html
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
<h2 id="r_git_config">Git Configuration</h2>
<div class="paragraph">
<p>
As you briefly saw in <a href="ch00/ch01-introduction">[ch01-introduction]</a>, you can specify Git configuration settings with the <code>git config</code> command.
As you briefly saw in <a href="{{< relurl "book/zh-tw/v2/ch00/ch01-introduction" >}}">[ch01-introduction]</a>, you can specify Git configuration settings with the <code>git config</code> command.
One of the first things you did was set up your name and email address:</p>
</div>
<div class="listingblock">
Expand Down Expand Up @@ -172,7 +172,7 @@ <h4 id="_core_pager"><code>core.pager</code></h4>
<h4 id="_user_signingkey"><code>user.signingkey</code></h4>
<div class="paragraph">
<p>
If you’re making signed annotated tags (as discussed in <a href="ch00/r_signing">Signing Your Work</a>), setting your GPG signing key as a configuration setting makes things easier.
If you’re making signed annotated tags (as discussed in <a href="{{< relurl "book/zh-tw/v2/ch00/r_signing" >}}">Signing Your Work</a>), setting your GPG signing key as a configuration setting makes things easier.
Set your key ID like so:</p>
</div>
<div class="listingblock">
Expand All @@ -193,7 +193,7 @@ <h4 id="_user_signingkey"><code>user.signingkey</code></h4>
<h4 id="_core_excludesfile"><code>core.excludesfile</code></h4>
<div class="paragraph">
<p>
You can put patterns in your project’s <code>.gitignore</code> file to have Git not see them as untracked files or try to stage them when you run <code>git add</code> on them, as discussed in <a href="ch00/r_ignoring">忽略不需要的檔案</a>.</p>
You can put patterns in your project’s <code>.gitignore</code> file to have Git not see them as untracked files or try to stage them when you run <code>git add</code> on them, as discussed in <a href="{{< relurl "book/zh-tw/v2/ch00/r_ignoring" >}}">忽略不需要的檔案</a>.</p>
</div>
<div class="paragraph">
<p>But sometimes you want to ignore certain files for all repositories that you work with.
Expand Down Expand Up @@ -398,7 +398,7 @@ <h3 id="r_external_merge_tools">External Merge and Diff Tools</h3>
</div>
<div class="imageblock">
<div class="content">
<img src="{{< relurl "book/en/v2/images/p4merge.png" >}}" alt="P4Merge.">
<img src="{{< relurl "book/zh-tw/v2/images/p4merge.png" >}}" alt="P4Merge.">
</div>
<div class="title">圖表 142. P4Merge.</div>
</div>
Expand Down Expand Up @@ -613,7 +613,7 @@ <h4 id="_receive_denydeletes"><code>receive.denyDeletes</code></h4>
<div class="paragraph">
<p>This denies any deletion of branches or tags – no user can do it.
To remove remote branches, you must remove the ref files from the server manually.
There are also more interesting ways to do this on a per-user basis via ACLs, as you’ll learn in <a href="ch00/r_an_example_git_enforced_policy">An Example Git-Enforced Policy</a>.</p>
There are also more interesting ways to do this on a per-user basis via ACLs, as you’ll learn in <a href="{{< relurl "book/zh-tw/v2/ch00/r_an_example_git_enforced_policy" >}}">An Example Git-Enforced Policy</a>.</p>
</div>
</div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion content/book/zh-tw/v2/Customizing-Git-Git-Hooks.html
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ <h3 id="_client_side_hooks">Client-Side Hooks</h3>
<td class="content">
<div class="paragraph">
<p>It’s important to note that client-side hooks are <strong>not</strong> copied when you clone a repository.
If your intent with these scripts is to enforce a policy, you’ll probably want to do that on the server side; see the example in <a href="ch00/r_an_example_git_enforced_policy">An Example Git-Enforced Policy</a>.</p>
If your intent with these scripts is to enforce a policy, you’ll probably want to do that on the server side; see the example in <a href="{{< relurl "book/zh-tw/v2/ch00/r_an_example_git_enforced_policy" >}}">An Example Git-Enforced Policy</a>.</p>
</div>
</td>
</tr>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,7 @@ <h3 id="_miscellaneous">Miscellaneous</h3>
<div class="paragraph">
<p><strong><code>GIT_ASKPASS</code></strong> is an override for the <code>core.askpass</code> configuration value.
This is the program invoked whenever Git needs to ask the user for credentials, which can expect a text prompt as a command-line argument, and should return the answer on <code>stdout</code>.
(See <a href="ch00/r_credential_caching">Credential Storage</a> for more on this subsystem.)</p>
(See <a href="{{< relurl "book/zh-tw/v2/ch00/r_credential_caching" >}}">Credential Storage</a> for more on this subsystem.)</p>
</div>
<div class="paragraph">
<p><strong><code>GIT_NAMESPACE</code></strong> controls access to namespaced refs, and is equivalent to the <code>--namespace</code> flag.
Expand Down
6 changes: 3 additions & 3 deletions content/book/zh-tw/v2/Git-Internals-Git-Objects.html
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ <h3 id="r_tree_objects">Tree Objects</h3>
</div>
<div class="imageblock">
<div class="content">
<img src="{{< relurl "book/en/v2/images/data-model-1.png" >}}" alt="Simple version of the Git data model.">
<img src="{{< relurl "book/zh-tw/v2/images/data-model-1.png" >}}" alt="Simple version of the Git data model.">
</div>
<div class="title">圖表 148. Simple version of the Git data model.</div>
</div>
Expand Down Expand Up @@ -266,7 +266,7 @@ <h3 id="r_tree_objects">Tree Objects</h3>
</div>
<div class="imageblock">
<div class="content">
<img src="{{< relurl "book/en/v2/images/data-model-2.png" >}}" alt="The content structure of your current Git data.">
<img src="{{< relurl "book/zh-tw/v2/images/data-model-2.png" >}}" alt="The content structure of your current Git data.">
</div>
<div class="title">圖表 149. The content structure of your current Git data.</div>
</div>
Expand Down Expand Up @@ -380,7 +380,7 @@ <h3 id="r_git_commit_objects">Commit Objects</h3>
</div>
<div class="imageblock">
<div class="content">
<img src="{{< relurl "book/en/v2/images/data-model-3.png" >}}" alt="All the objects in your Git directory.">
<img src="{{< relurl "book/zh-tw/v2/images/data-model-3.png" >}}" alt="All the objects in your Git directory.">
</div>
<div class="title">圖表 150. All the objects in your Git directory.</div>
</div>
Expand Down
4 changes: 2 additions & 2 deletions content/book/zh-tw/v2/Git-Internals-Git-References.html
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ <h2 id="r_git_refs">Git References</h2>
</div>
<div class="imageblock">
<div class="content">
<img src="{{< relurl "book/en/v2/images/data-model-4.png" >}}" alt="Git directory objects with branch head references included.">
<img src="{{< relurl "book/zh-tw/v2/images/data-model-4.png" >}}" alt="Git directory objects with branch head references included.">
</div>
<div class="title">圖表 151. Git directory objects with branch head references included.</div>
</div>
Expand Down Expand Up @@ -162,7 +162,7 @@ <h3 id="_tags">Tags</h3>
It’s like a branch reference, but it never moves – it always points to the same commit but gives it a friendlier name.</p>
</div>
<div class="paragraph">
<p>As discussed in <a href="ch00/ch02-git-basics">[ch02-git-basics]</a>, there are two types of tags: annotated and lightweight.
<p>As discussed in <a href="{{< relurl "book/zh-tw/v2/ch00/ch02-git-basics" >}}">[ch02-git-basics]</a>, there are two types of tags: annotated and lightweight.
You can make a lightweight tag by running something like this:</p>
</div>
<div class="listingblock">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ <h3 id="r_data_recovery">Data Recovery</h3>
<p>Often, the quickest way is to use a tool called <code>git reflog</code>.
As you’re working, Git silently records what your HEAD is every time you change it.
Each time you commit or change branches, the reflog is updated.
The reflog is also updated by the <code>git update-ref</code> command, which is another reason to use it instead of just writing the SHA-1 value to your ref files, as we covered in <a href="ch00/r_git_refs">Git References</a>.
The reflog is also updated by the <code>git update-ref</code> command, which is another reason to use it instead of just writing the SHA-1 value to your ref files, as we covered in <a href="{{< relurl "book/zh-tw/v2/ch00/r_git_refs" >}}">Git References</a>.
You can see where you’ve been at any time by running <code>git reflog</code>:</p>
</div>
<div class="listingblock">
Expand Down Expand Up @@ -307,7 +307,7 @@ <h3 id="r_removing_objects">Removing Objects</h3>
</div>
<div class="paragraph">
<p>The big object is at the bottom: 5MB.
To find out what file it is, you’ll use the <code>rev-list</code> command, which you used briefly in <a href="ch00/r_enforcing_commit_message_format">Enforcing a Specific Commit-Message Format</a>.
To find out what file it is, you’ll use the <code>rev-list</code> command, which you used briefly in <a href="{{< relurl "book/zh-tw/v2/ch00/r_enforcing_commit_message_format" >}}">Enforcing a Specific Commit-Message Format</a>.
If you pass <code>--objects</code> to <code>rev-list</code>, it lists all the commit SHA-1s and also the blob SHA-1s with the file paths associated with them.
You can use this to find your blob’s name:</p>
</div>
Expand All @@ -330,7 +330,7 @@ <h3 id="r_removing_objects">Removing Objects</h3>
</div>
<div class="paragraph">
<p>You must rewrite all the commits downstream from <code>7b30847</code> to fully remove this file from your Git history.
To do so, you use <code>filter-branch</code>, which you used in <a href="ch00/r_rewriting_history">Rewriting History</a>:</p>
To do so, you use <code>filter-branch</code>, which you used in <a href="{{< relurl "book/zh-tw/v2/ch00/r_rewriting_history" >}}">Rewriting History</a>:</p>
</div>
<div class="listingblock">
<div class="content">
Expand All @@ -342,7 +342,7 @@ <h3 id="r_removing_objects">Removing Objects</h3>
</div>
</div>
<div class="paragraph">
<p>The <code>--index-filter</code> option is similar to the <code>--tree-filter</code> option used in <a href="ch00/r_rewriting_history">Rewriting History</a>, except that instead of passing a command that modifies files checked out on disk, you’re modifying your staging area or index each time.</p>
<p>The <code>--index-filter</code> option is similar to the <code>--tree-filter</code> option used in <a href="{{< relurl "book/zh-tw/v2/ch00/r_rewriting_history" >}}">Rewriting History</a>, except that instead of passing a command that modifies files checked out on disk, you’re modifying your staging area or index each time.</p>
</div>
<div class="paragraph">
<p>Rather than remove a specific file with something like <code>rm file</code>, you have to remove it with <code>git rm --cached</code> – you must remove it from the index, not from disk.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ <h2 id="r_plumbing_porcelain">Plumbing and Porcelain</h2>
<p>You may see some other files in there, but this is a fresh <code>git init</code> repository – it’s what you see by default.
The <code>description</code> file is only used by the GitWeb program, so don’t worry about it.
The <code>config</code> file contains your project-specific configuration options, and the <code>info</code> directory keeps a global exclude file for ignored patterns that you don’t want to track in a .gitignore file.
The <code>hooks</code> directory contains your client- or server-side hook scripts, which are discussed in detail in <a href="ch00/r_git_hooks">Git Hooks</a>.</p>
The <code>hooks</code> directory contains your client- or server-side hook scripts, which are discussed in detail in <a href="{{< relurl "book/zh-tw/v2/ch00/r_git_hooks" >}}">Git Hooks</a>.</p>
</div>
<div class="paragraph">
<p>This leaves four important entries: the <code>HEAD</code> and (yet to be created) <code>index</code> files, and the <code>objects</code> and <code>refs</code> directories.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1066,7 +1066,7 @@ <h6 id="_setting_up_2">Setting Up</h6>
</div>
<div class="imageblock">
<div class="content">
<img src="{{< relurl "book/en/v2/images/git-fusion-boot.png" >}}" alt="The Git Fusion virtual machine boot screen.">
<img src="{{< relurl "book/zh-tw/v2/images/git-fusion-boot.png" >}}" alt="The Git Fusion virtual machine boot screen.">
</div>
<div class="title">圖表 145. The Git Fusion virtual machine boot screen.</div>
</div>
Expand Down Expand Up @@ -1353,7 +1353,7 @@ <h6 id="_workflow_2">Workflow</h6>
</div>
<div class="imageblock">
<div class="content">
<img src="{{< relurl "book/en/v2/images/git-fusion-perforce-graph.png" >}}" alt="Perforce revision graph resulting from Git push.">
<img src="{{< relurl "book/zh-tw/v2/images/git-fusion-perforce-graph.png" >}}" alt="Perforce revision graph resulting from Git push.">
</div>
<div class="title">圖表 146. Perforce revision graph resulting from Git push.</div>
</div>
Expand Down Expand Up @@ -2257,7 +2257,7 @@ <h4 id="_workflow_git_tfs">Workflow: <code>git-tfs</code>
</div>
<div class="imageblock">
<div class="content">
<img src="{{< relurl "book/en/v2/images/git-tfs-ct.png" >}}" alt="The git-tfs checkin tool.">
<img src="{{< relurl "book/zh-tw/v2/images/git-tfs-ct.png" >}}" alt="The git-tfs checkin tool.">
</div>
<div class="title">圖表 147. The git-tfs checkin tool.</div>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,7 @@ <h3 id="r_perforce_import">Perforce</h3>
<h4 id="_perforce_git_fusion">Perforce Git Fusion</h4>
<div class="paragraph">
<p>Git Fusion makes this process fairly painless.
Just configure your project settings, user mappings, and branches using a configuration file (as discussed in <a href="ch00/r_p4_git_fusion">Git Fusion</a>), and clone the repository.
Just configure your project settings, user mappings, and branches using a configuration file (as discussed in <a href="{{< relurl "book/zh-tw/v2/ch00/r_p4_git_fusion" >}}">Git Fusion</a>), and clone the repository.
Git Fusion leaves you with what looks like a native Git repository, which is then ready to push to a native Git host if you desire.
You could even use Perforce as your Git host if you like.</p>
</div>
Expand Down Expand Up @@ -352,7 +352,7 @@ <h4 id="r_git_p4">Git-p4</h4>
</div>
<div class="paragraph">
<p>This particular project has only one branch, but if you have branches that are configured with branch views (or just a set of directories), you can use the <code>--detect-branches</code> flag to <code>git p4 clone</code> to import all the project’s branches as well.
See <a href="ch00/r_git_p4_branches">Branching</a> for a bit more detail on this.</p>
See <a href="{{< relurl "book/zh-tw/v2/ch00/r_git_p4_branches" >}}">Branching</a> for a bit more detail on this.</p>
</div>
<div class="paragraph">
<p>At this point you’re almost done.
Expand Down Expand Up @@ -503,7 +503,7 @@ <h3 id="r_custom_importer">A Custom Importer</h3>
If your system isn’t one of the above, you should look for an importer online – quality importers are available for many other systems, including CVS, Clear Case, Visual Source Safe, even a directory of archives.
If none of these tools works for you, you have a more obscure tool, or you otherwise need a more custom importing process, you should use <code>git fast-import</code>.
This command reads simple instructions from stdin to write specific Git data.
It’s much easier to create Git objects this way than to run the raw Git commands or try to write the raw objects (see <a href="ch00/ch10-git-internals">[ch10-git-internals]</a> for more information).
It’s much easier to create Git objects this way than to run the raw Git commands or try to write the raw objects (see <a href="{{< relurl "book/zh-tw/v2/ch00/ch10-git-internals" >}}">[ch10-git-internals]</a> for more information).
This way, you can write an import script that reads the necessary information out of the system you’re importing from and prints straightforward instructions to stdout.
You can then run this program and pipe its output through <code>git fast-import</code>.</p>
</div>
Expand All @@ -529,7 +529,7 @@ <h3 id="r_custom_importer">A Custom Importer</h3>
Your strategy will be to go through the snapshots one at a time and create commits with the contents of each directory, linking each commit back to the previous one.</p>
</div>
<div class="paragraph">
<p>As we did in <a href="ch00/r_an_example_git_enforced_policy">An Example Git-Enforced Policy</a>, we’ll write this in Ruby, because it’s what we generally work with and it tends to be easy to read.
<p>As we did in <a href="{{< relurl "book/zh-tw/v2/ch00/r_an_example_git_enforced_policy" >}}">An Example Git-Enforced Policy</a>, we’ll write this in Ruby, because it’s what we generally work with and it tends to be easy to read.
You can write this example pretty easily in anything you’re familiar with – it just needs to print the appropriate information to <code>stdout</code>.
And, if you are running on Windows, this means you’ll need to take special care to not introduce carriage returns at the end your lines – git fast-import is very particular about just wanting line feeds (LF) not the carriage return line feeds (CRLF) that Windows uses.</p>
</div>
Expand Down
Loading

0 comments on commit a246ddf

Please sign in to comment.