git documentation - en to zh_HANS-CN translation catalogue (53 entries)

note: type: Plain text
en: Be verbose.
zh_HANS-CN: 冗余模式。

note: type: Plain text
en: Transmit the given string to the server when communicating using protocol version 2.  The given string must not contain a NUL or LF character.  The server's handling of server options, including unknown ones, is server-specific.  When multiple `--server-option=<option>` are given, they are all sent to the other side in the order listed on the command line.
zh_HANS-CN: 使用协议版本2进行通信时，将给定的字符串传输到服务器。给定的字符串不得包含NUL或LF字符。服务器对服务器选项（包括未知选项）的处理是取决于服务器。当给出多个`--server-option = <option>`时，它们都按照命令行中列出的顺序发送到另一端。

note: type: Title -
en: NAME
zh_HANS-CN: 名称

note: type: Plain text
en: git-add - Add file contents to the index
zh_HANS-CN: git-add - 添加内容到索引

note: type: Title -
en: SYNOPSIS
zh_HANS-CN: 概述

note: type: Title -
en: DESCRIPTION
zh_HANS-CN: 描述

note: type: Plain text
en: This command updates the index using the current content found in the working tree, to prepare the content staged for the next commit.  It typically adds the current content of existing paths as a whole, but with some options it can also be used to add content with only part of the changes made to the working tree files applied, or remove paths that do not exist in the working tree anymore.
zh_HANS-CN: 该命令在工作树中找到的当前的内容以更新索引，为下一次提交准备暂存的内容。它通常会整体添加现有路径的当前内容，但是通过某些选项，它也可以用于仅添加对工作树文件所做的部分更改，或删除工作树中不存在的路径。

note: type: Plain text
en: The "index" holds a snapshot of the content of the working tree, and it is this snapshot that is taken as the contents of the next commit.  Thus after making any changes to the working tree, and before running the commit command, you must use the `add` command to add any new or modified files to the index.
zh_HANS-CN: “索引”保存着工作树内容的快照，该快照作为下一次提交的内容。因此，在对工作树进行任何更改之后，以及在运行commit命令之前，必须使用`add`命令将所有新文件或修改过的文件添加到索引中。

note: type: Plain text
en: This command can be performed multiple times before a commit.  It only adds the content of the specified file(s) at the time the add command is run; if you want subsequent changes included in the next commit, then you must run `git add` again to add the new content to the index.
zh_HANS-CN: 提交前可以多次执行此命令。它仅在运行add命令时添加指定文件的内容；如果要在下一次提交中包含后续更改，则必须再次运行`git add`将新内容添加到索引中。

note: type: Plain text
en: The `git status` command can be used to obtain a summary of which files have changes that are staged for the next commit.
zh_HANS-CN: `git status` 命令可用于获取摘要，说明哪些变化的文件已暂存，准备下一次提交。

note: type: Plain text
en: The `git add` command will not add ignored files by default.  If any ignored files were explicitly specified on the command line, `git add` will fail with a list of ignored files.  Ignored files reached by directory recursion or filename globbing performed by Git (quote your globs before the shell) will be silently ignored.  The 'git add' command can be used to add ignored files with the `-f` (force) option.
zh_HANS-CN: `git add` 命令默认不会添加被忽略的文件。如果在命令行上明确指定了任何被忽略的文件，则`git add`会失败，并显示被忽略文件的列表。由目录递归或Git执行的文件名通配符（在shell之前引用的通配符）所涉及的忽略文件将被静默忽略。 'git add' 命令可用于通过 -f 选项（force）强制添加忽略的文件。

note: type: Plain text
en: Please see linkgit:git-commit[1] for alternative ways to add content to a commit.
zh_HANS-CN: 请参阅 linkgit:git-commit[1] 了解将内容添加到提交的其他替代方法。

note: type: Title -
en: OPTIONS
zh_HANS-CN: 选项

note: type: Plain text
en: Files to add content from.  Fileglobs (e.g. `*.c`) can be given to add all matching files.  Also a leading directory name (e.g. `dir` to add `dir/file1` and `dir/file2`) can be given to update the index to match the current state of the directory as a whole (e.g.  specifying `dir` will record not just a file `dir/file1` modified in the working tree, a file `dir/file2` added to the working tree, but also a file `dir/file3` removed from the working tree). Note that older versions of Git used to ignore removed files; use `--no-all` option if you want to add modified or new files but ignore removed ones.
zh_HANS-CN: 要从中添加内容的文件。Fileglobs（例如`*.c`）可以用来添加所有匹配的文件。此外，还可以提供一个前导目录名（例如，指定`dir`以添加`dir/file1`和`dir/file2`）来更新索引，使其与整个目录的当前状态相匹配（例如，指定`dir`不仅会记录在工作树中修改的文件`dir/file1`，还会记录在工作树中添加的文件`dir/file2`，还有从工作树中删除的文件`dir/file3`）。请注意，旧版本的Git会忽略已删除的文件；如果要添加已修改的文件或新文件，但忽略已删除的文件，请使用“--no all”选项。

note: type: Plain text
en: For more details about the <pathspec> syntax, see the 'pathspec' entry in linkgit:gitglossary[7].
zh_HANS-CN: 有关 <pathspec> 格式的更多细节，请参考 linkgit:gitglossary[7]。

note: type: Plain text
en: Don't actually add the file(s), just show if they exist and/or will be ignored.
zh_HANS-CN: 实际上不添加文件，仅展示文件是否存在或是否忽略。

note: type: Plain text
en: Allow adding otherwise ignored files.
zh_HANS-CN: 允许添加已被忽略的文件。

note: type: Plain text
en: Add modified contents in the working tree interactively to the index. Optional path arguments may be supplied to limit operation to a subset of the working tree. See ``Interactive mode'' for details.
zh_HANS-CN: 以交互方式将工作树中的修改内容添加到索引。可以提供可选的路径参数，以将操作限制为工作树的子集。有关详细信息，请参见``交互模式''。

note: type: Plain text
en: Interactively choose hunks of patch between the index and the work tree and add them to the index. This gives the user a chance to review the difference before adding modified contents to the index.
zh_HANS-CN: 交互地在索引和工作树之间选择补丁块并将它们添加到索引中。这让用户有机会在将修改后的内容添加到索引之前查看差异。

note: type: Plain text
en: This effectively runs `add --interactive`, but bypasses the initial command menu and directly jumps to the `patch` subcommand.  See ``Interactive mode'' for details.
zh_HANS-CN: 这可以有效地运行`add --interactive`，但是会绕过初始命令菜单，而直接跳转到“ patch”子命令。有关详细信息，请参见``交互模式''。

note: type: Plain text
en: Open the diff vs. the index in an editor and let the user edit it.  After the editor was closed, adjust the hunk headers and apply the patch to the index.
zh_HANS-CN: 在编辑器中打开与索引的差异，使用户进行编辑。关闭编辑器后，调整块补丁头并将其应用于索引。

note: type: Plain text
en: The intent of this option is to pick and choose lines of the patch to apply, or even to modify the contents of lines to be staged. This can be quicker and more flexible than using the interactive hunk selector.  However, it is easy to confuse oneself and create a patch that does not apply to the index. See EDITING PATCHES below.
zh_HANS-CN: 此选项的目的是选择并选择要应用的补丁的行，甚至修改要暂存的行的内容。与使用交互式补丁块选择器相比，其更快，更灵活。但是，很容易混淆自己并创建不应用于索引的补丁。请参阅下面的编辑补丁。

note: type: Plain text
en: Update the index just where it already has an entry matching <pathspec>.  This removes as well as modifies index entries to match the working tree, but adds no new files.
zh_HANS-CN: 在索引已经具有与<pathspec>匹配项的地方更新索引。这会删除和修改索引项以匹配工作树，但不添加新文件。

note: type: Plain text
en: If no <pathspec> is given when `-u` option is used, all tracked files in the entire working tree are updated (old versions of Git used to limit the update to the current directory and its subdirectories).
zh_HANS-CN: 如果在使用`-u`选项时未指定<pathspec>，则整个工作树中的所有跟踪文件都将更新（旧版本Git会限制更新当前目录及其子目录）。

note: type: Plain text
en: Update the index not only where the working tree has a file matching <pathspec> but also where the index already has an entry. This adds, modifies, and removes index entries to match the working tree.
zh_HANS-CN: 不仅在工作树中有与<pathspec>匹配的文件的地方更新索引，而且在索引中已经有一个项的地方更新索引。这将添加、修改和删除与工作树匹配的索引项。

note: type: Plain text
en: If no <pathspec> is given when `-A` option is used, all files in the entire working tree are updated (old versions of Git used to limit the update to the current directory and its subdirectories).
zh_HANS-CN: 如果在使用`-A`选项时未指定<pathspec>，则整个工作树中的所有文件都将更新（旧版本的Git会限制当前目录及其子目录的更新）。

note: type: Plain text
en: Update the index by adding new files that are unknown to the index and files modified in the working tree, but ignore files that have been removed from the working tree.  This option is a no-op when no <pathspec> is used.
zh_HANS-CN: 通过添加索引未知的新文件和在工作树中修改的文件以更新索引，但忽略已从工作树中删除的文件。当不使用<pathspec>时，此选项是必须的。

note: type: Plain text
en: This option is primarily to help users who are used to older versions of Git, whose "git add <pathspec>..." was a synonym for "git add --no-all <pathspec>...", i.e. ignored removed files.
zh_HANS-CN: 此选项主要用于帮助那些习惯于较旧版本Git的用户。旧版本中的"Git add<pathspec>..."是"Git add--no all<pathspec>..."的同义词，即忽略已删除的文件。

note: type: Plain text
en: Don't add the file(s), but only refresh their stat()  information in the index.
zh_HANS-CN: 不添加文件，只刷新索引中的stat()信息。

note: type: Plain text
en: If some files could not be added because of errors indexing them, do not abort the operation, but continue adding the others. The command shall still exit with non-zero status.  The configuration variable `add.ignoreErrors` can be set to true to make this the default behaviour.
zh_HANS-CN: 如果由于索引错误而无法添加某些文件，请不要中止操作，而是继续添加其他文件。命令仍应以非零状态退出。可以将配置变量`add.ignoreErrors`设置为true，使其成为默认行为。

note: type: Plain text
en: This option can only be used together with --dry-run. By using this option the user can check if any of the given files would be ignored, no matter if they are already present in the work tree or not.
zh_HANS-CN: 此选项只能与--dry-run一起使用。通过使用此选项，用户可以检查是否会忽略任何给定的文件，无论它们是否已存在于工作树中。

note: type: Plain text
en: By default, `git add` will warn when adding an embedded repository to the index without using `git submodule add` to create an entry in `.gitmodules`. This option will suppress the warning (e.g., if you are manually performing operations on submodules).
zh_HANS-CN: 默认情况下，`git add`将在向索引添加嵌入式存储库时发出警告，而不使用`git submodule add`在`.gitmodules`中创建条目。此选项将抑制警告（例如，如果手动对子模块执行操作）。

note: type: Plain text
en: Apply the "clean" process freshly to all tracked files to forcibly add them again to the index.  This is useful after changing `core.autocrlf` configuration or the `text` attribute in order to correct files added with wrong CRLF/LF line endings.  This option implies `-u`.
zh_HANS-CN: 对所有跟踪的文件应用`clean`过程，将它们再次强制添加到索引中。这在更改`core.autocrlf`配置或`text`属性以更正添加了错误CRLF/LF行结尾的文件后非常有用。此选项隐含`-u`选项。

note: type: Plain text
en: Override the executable bit of the added files.  The executable bit is only changed in the index, the files on disk are left unchanged.
zh_HANS-CN: 重写添加文件的可执行位。可执行位仅在索引中更改，磁盘上的文件保持不变。

note: type: Plain text
en: Only meaningful with `--pathspec-from-file`. Pathspec elements are separated with NUL character and all other characters are taken literally (including newlines and quotes).
zh_HANS-CN: 只有在使用`--pathspec-from-file”时才有意义。Pathspec元素用NUL字符分隔，所有其他字符都按字面意思（包括换行符和引号）表示。

note: type: Plain text
en: This option can be used to separate command-line options from the list of files, (useful when filenames might be mistaken for command-line options).
zh_HANS-CN: 此选项可用于分离命令行选项和文件列表（当文件名可能被误认为命令行选项时非常有用）。

note: type: Title -
en: EXAMPLES
zh_HANS-CN: 实例

note: type: Plain text
en: Adds content from all `*.txt` files under `Documentation` directory and its subdirectories:
zh_HANS-CN: 添加`Documentation`目录及其子目录下所有`*.txt`文件的内容：

note: type: Plain text
en: Note that the asterisk `*` is quoted from the shell in this example; this lets the command include the files from subdirectories of `Documentation/` directory.
zh_HANS-CN: 注意，在本例中，星号`*`是从shell中引入的；这使命令可以包含`Documentation/`中子目录的文件。

note: type: Plain text
en: Because this example lets the shell expand the asterisk (i.e. you are listing the files explicitly), it does not consider `subdir/git-foo.sh`.
zh_HANS-CN: 因为这个示例允许shell扩展星号（即显式列出文件），所以它不包含`subdir/git-foo.sh`。

note: type: Title -
en: INTERACTIVE MODE
zh_HANS-CN: 交互模式

note: type: Plain text
en: When the command enters the interactive mode, it shows the output of the 'status' subcommand, and then goes into its interactive command loop.
zh_HANS-CN: 当命令进入交互模式时，它将显示`status`子命令的输出，然后进入其交互命令循环。

note: type: Plain text
en: The command loop shows the list of subcommands available, and gives a prompt "What now> ".  In general, when the prompt ends with a single '>', you can pick only one of the choices given and type return, like this:
zh_HANS-CN: 命令循环显示可用的子命令列表，并提示`What now>`。通常，当提示以单个`>`结尾时，您只能选择给定的一个选项并键入return，如下所示：

note: type: Plain text
en: You also could say `s` or `sta` or `status` above as long as the choice is unique.
zh_HANS-CN: 你也可以输入`s`、`sta`或`status`，只要候选项是唯一的。

note: type: Plain text
en: The main command loop has 6 subcommands (plus help and quit).
zh_HANS-CN: 主命令循环有6个子命令（包括帮助和退出）。

note: type: Plain text
en: This shows the change between HEAD and index (i.e. what will be committed if you say `git commit`), and between index and working tree files (i.e. what you could stage further before `git commit` using `git add`) for each path.  A sample output looks like this:
zh_HANS-CN: 这将显示每个路径下HEAD和索引之间的更改（即，如果输入`git commit`，将提交什么），以及索引和工作树文件之间的更改（即，在输入`git commit`之前，执行`git add`可以进一步暂存什么）。示例输出如下：

note: type: Plain text
en: It shows that foo.png has differences from HEAD (but that is binary so line count cannot be shown) and there is no difference between indexed copy and the working tree version (if the working tree version were also different, 'binary' would have been shown in place of 'nothing').  The other file, git-add{litdd}interactive.perl, has 403 lines added and 35 lines deleted if you commit what is in the index, but working tree file has further modifications (one addition and one deletion).
zh_HANS-CN: 它表明foo.png与HEAD有区别（但其是二进制的，因此无法显示行数），索引副本和工作树版本之间没有区别（如果工作树版本也不同，`nothing`的位置上会显示`binary`）。另一个文件git add-{litdd}interactive.perl添加了403行，如果提交索引中的内容，则删除了35行，但工作树文件有额外修改（一次添加一次删除）。

note: type: Plain text
en: This shows the status information and issues an "Update>>" prompt.  When the prompt ends with double '>>', you can make more than one selection, concatenated with whitespace or comma.  Also you can say ranges.  E.g. "2-5 7,9" to choose 2,3,4,5,7,9 from the list.  If the second number in a range is omitted, all remaining patches are taken.  E.g. "7-" to choose 7,8,9 from the list.  You can say '*' to choose everything.
zh_HANS-CN: 这将显示状态信息并发出“更新>>”提示。当提示以“>>”结尾时，可以进行多个选择，并用空格或逗号连接。你也可以输入范围。例如：“2-5 7,9”将从列表中选择2、3、4、5、7、9。如果省略一个范围中的第二个数字，则将获取所有剩余的补丁。例如：“7-”从列表中选择7、8、9。你可以输入“*”来选择全部补丁。

note: type: Plain text
en: What you chose are then highlighted with '*', like this:
zh_HANS-CN: 您选择的内容会用“*”突出显示，如下所示：

note: type: Plain text
en: To remove selection, prefix the input with `-` like this:
zh_HANS-CN: 要删除选定内容，请在输入前加上`-`，如下所示：

note: type: Plain text
en: After making the selection, answer with an empty line to stage the contents of working tree files for selected paths in the index.
zh_HANS-CN: 进行选择后，输入空行，以便为索引中选定的路径暂存工作树文件的内容。

note: type: Plain text
en: This has a very similar UI to 'update', and the staged information for selected paths are reverted to that of the HEAD version.  Reverting new paths makes them untracked.
zh_HANS-CN: 它有一个与s`update`非常相似的UI，所选路径的暂存信息将还原为HEAD版本。还原新路径将使它们不被追踪。

note: type: Labeled list
en: <file>
zh_HANS-CN: <>
