Merge branch 'ja/git-add-doc-markup'
Documentation mark-up updates. * ja/git-add-doc-markup: doc: git-add.txt: convert to new style convention
This commit is contained in:
@@ -1,7 +1,12 @@
|
|||||||
add.ignoreErrors::
|
`add.ignoreErrors`::
|
||||||
add.ignore-errors (deprecated)::
|
`add.ignore-errors` (deprecated)::
|
||||||
Tells 'git add' to continue adding files when some files cannot be
|
Tells `git add` to continue adding files when some files cannot be
|
||||||
added due to indexing errors. Equivalent to the `--ignore-errors`
|
added due to indexing errors.
|
||||||
option of linkgit:git-add[1]. `add.ignore-errors` is deprecated,
|
ifdef::git-add[]
|
||||||
as it does not follow the usual naming convention for configuration
|
Equivalent to the `--ignore-errors` option.
|
||||||
variables.
|
endif::git-add[]
|
||||||
|
ifndef::git-add[]
|
||||||
|
Equivalent to the `--ignore-errors` option of linkgit:git-add[1].
|
||||||
|
endif::git-add[]
|
||||||
|
`add.ignore-errors` is deprecated, as it does not follow the usual
|
||||||
|
naming convention for configuration variables.
|
||||||
|
|||||||
@@ -7,12 +7,12 @@ git-add - Add file contents to the index
|
|||||||
|
|
||||||
SYNOPSIS
|
SYNOPSIS
|
||||||
--------
|
--------
|
||||||
[verse]
|
[synopsis]
|
||||||
'git add' [--verbose | -v] [--dry-run | -n] [--force | -f] [--interactive | -i] [--patch | -p]
|
git add [--verbose | -v] [--dry-run | -n] [--force | -f] [--interactive | -i] [--patch | -p]
|
||||||
[--edit | -e] [--[no-]all | -A | --[no-]ignore-removal | [--update | -u]] [--sparse]
|
[--edit | -e] [--[no-]all | -A | --[no-]ignore-removal | [--update | -u]] [--sparse]
|
||||||
[--intent-to-add | -N] [--refresh] [--ignore-errors] [--ignore-missing] [--renormalize]
|
[--intent-to-add | -N] [--refresh] [--ignore-errors] [--ignore-missing] [--renormalize]
|
||||||
[--chmod=(+|-)x] [--pathspec-from-file=<file> [--pathspec-file-nul]]
|
[--chmod=(+|-)x] [--pathspec-from-file=<file> [--pathspec-file-nul]]
|
||||||
[--] [<pathspec>...]
|
[--] [<pathspec>...]
|
||||||
|
|
||||||
DESCRIPTION
|
DESCRIPTION
|
||||||
-----------
|
-----------
|
||||||
@@ -41,7 +41,7 @@ The `git add` command will not add ignored files by default. If any
|
|||||||
ignored files were explicitly specified on the command line, `git add`
|
ignored files were explicitly specified on the command line, `git add`
|
||||||
will fail with a list of ignored files. Ignored files reached by
|
will fail with a list of ignored files. Ignored files reached by
|
||||||
directory recursion or filename globbing performed by Git (quote your
|
directory recursion or filename globbing performed by Git (quote your
|
||||||
globs before the shell) will be silently ignored. The 'git add' command can
|
globs before the shell) will be silently ignored. The `git add` command can
|
||||||
be used to add ignored files with the `-f` (force) option.
|
be used to add ignored files with the `-f` (force) option.
|
||||||
|
|
||||||
Please see linkgit:git-commit[1] for alternative ways to add content to a
|
Please see linkgit:git-commit[1] for alternative ways to add content to a
|
||||||
@@ -50,7 +50,7 @@ commit.
|
|||||||
|
|
||||||
OPTIONS
|
OPTIONS
|
||||||
-------
|
-------
|
||||||
<pathspec>...::
|
`<pathspec>...`::
|
||||||
Files to add content from. Fileglobs (e.g. `*.c`) can
|
Files to add content from. Fileglobs (e.g. `*.c`) can
|
||||||
be given to add all matching files. Also a
|
be given to add all matching files. Also a
|
||||||
leading directory name (e.g. `dir` to add `dir/file1`
|
leading directory name (e.g. `dir` to add `dir/file1`
|
||||||
@@ -66,35 +66,35 @@ OPTIONS
|
|||||||
For more details about the _<pathspec>_ syntax, see the 'pathspec' entry
|
For more details about the _<pathspec>_ syntax, see the 'pathspec' entry
|
||||||
in linkgit:gitglossary[7].
|
in linkgit:gitglossary[7].
|
||||||
|
|
||||||
-n::
|
`-n`::
|
||||||
--dry-run::
|
`--dry-run`::
|
||||||
Don't actually add the file(s), just show if they exist and/or will
|
Don't actually add the file(s), just show if they exist and/or will
|
||||||
be ignored.
|
be ignored.
|
||||||
|
|
||||||
-v::
|
`-v`::
|
||||||
--verbose::
|
`--verbose`::
|
||||||
Be verbose.
|
Be verbose.
|
||||||
|
|
||||||
-f::
|
`-f`::
|
||||||
--force::
|
`--force`::
|
||||||
Allow adding otherwise ignored files.
|
Allow adding otherwise ignored files.
|
||||||
|
|
||||||
--sparse::
|
`--sparse`::
|
||||||
Allow updating index entries outside of the sparse-checkout cone.
|
Allow updating index entries outside of the sparse-checkout cone.
|
||||||
Normally, `git add` refuses to update index entries whose paths do
|
Normally, `git add` refuses to update index entries whose paths do
|
||||||
not fit within the sparse-checkout cone, since those files might
|
not fit within the sparse-checkout cone, since those files might
|
||||||
be removed from the working tree without warning. See
|
be removed from the working tree without warning. See
|
||||||
linkgit:git-sparse-checkout[1] for more details.
|
linkgit:git-sparse-checkout[1] for more details.
|
||||||
|
|
||||||
-i::
|
`-i`::
|
||||||
--interactive::
|
`--interactive`::
|
||||||
Add modified contents in the working tree interactively to
|
Add modified contents in the working tree interactively to
|
||||||
the index. Optional path arguments may be supplied to limit
|
the index. Optional path arguments may be supplied to limit
|
||||||
operation to a subset of the working tree. See ``Interactive
|
operation to a subset of the working tree. See ``Interactive
|
||||||
mode'' for details.
|
mode'' for details.
|
||||||
|
|
||||||
-p::
|
`-p`::
|
||||||
--patch::
|
`--patch`::
|
||||||
Interactively choose hunks of patch between the index and the
|
Interactively choose hunks of patch between the index and the
|
||||||
work tree and add them to the index. This gives the user a chance
|
work tree and add them to the index. This gives the user a chance
|
||||||
to review the difference before adding modified contents to the
|
to review the difference before adding modified contents to the
|
||||||
@@ -104,8 +104,8 @@ This effectively runs `add --interactive`, but bypasses the
|
|||||||
initial command menu and directly jumps to the `patch` subcommand.
|
initial command menu and directly jumps to the `patch` subcommand.
|
||||||
See ``Interactive mode'' for details.
|
See ``Interactive mode'' for details.
|
||||||
|
|
||||||
-e::
|
`-e`::
|
||||||
--edit::
|
`--edit`::
|
||||||
Open the diff vs. the index in an editor and let the user
|
Open the diff vs. the index in an editor and let the user
|
||||||
edit it. After the editor was closed, adjust the hunk headers
|
edit it. After the editor was closed, adjust the hunk headers
|
||||||
and apply the patch to the index.
|
and apply the patch to the index.
|
||||||
@@ -116,8 +116,8 @@ quicker and more flexible than using the interactive hunk selector.
|
|||||||
However, it is easy to confuse oneself and create a patch that does not
|
However, it is easy to confuse oneself and create a patch that does not
|
||||||
apply to the index. See EDITING PATCHES below.
|
apply to the index. See EDITING PATCHES below.
|
||||||
|
|
||||||
-u::
|
`-u`::
|
||||||
--update::
|
`--update`::
|
||||||
Update the index just where it already has an entry matching
|
Update the index just where it already has an entry matching
|
||||||
_<pathspec>_. This removes as well as modifies index entries to
|
_<pathspec>_. This removes as well as modifies index entries to
|
||||||
match the working tree, but adds no new files.
|
match the working tree, but adds no new files.
|
||||||
@@ -127,9 +127,9 @@ tracked files in the entire working tree are updated (old versions
|
|||||||
of Git used to limit the update to the current directory and its
|
of Git used to limit the update to the current directory and its
|
||||||
subdirectories).
|
subdirectories).
|
||||||
|
|
||||||
-A::
|
`-A`::
|
||||||
--all::
|
`--all`::
|
||||||
--no-ignore-removal::
|
`--no-ignore-removal`::
|
||||||
Update the index not only where the working tree has a file
|
Update the index not only where the working tree has a file
|
||||||
matching _<pathspec>_ but also where the index already has an
|
matching _<pathspec>_ but also where the index already has an
|
||||||
entry. This adds, modifies, and removes index entries to
|
entry. This adds, modifies, and removes index entries to
|
||||||
@@ -140,77 +140,77 @@ files in the entire working tree are updated (old versions
|
|||||||
of Git used to limit the update to the current directory and its
|
of Git used to limit the update to the current directory and its
|
||||||
subdirectories).
|
subdirectories).
|
||||||
|
|
||||||
--no-all::
|
`--no-all`::
|
||||||
--ignore-removal::
|
`--ignore-removal`::
|
||||||
Update the index by adding new files that are unknown to the
|
Update the index by adding new files that are unknown to the
|
||||||
index and files modified in the working tree, but ignore
|
index and files modified in the working tree, but ignore
|
||||||
files that have been removed from the working tree. This
|
files that have been removed from the working tree. This
|
||||||
option is a no-op when no _<pathspec>_ is used.
|
option is a no-op when no _<pathspec>_ is used.
|
||||||
+
|
+
|
||||||
This option is primarily to help users who are used to older
|
This option is primarily to help users who are used to older
|
||||||
versions of Git, whose "git add _<pathspec>_..." was a synonym
|
versions of Git, whose `git add <pathspec>...` was a synonym
|
||||||
for "git add --no-all _<pathspec>_...", i.e. ignored removed files.
|
for `git add --no-all <pathspec>...`, i.e. ignored removed files.
|
||||||
|
|
||||||
-N::
|
`-N`::
|
||||||
--intent-to-add::
|
`--intent-to-add`::
|
||||||
Record only the fact that the path will be added later. An entry
|
Record only the fact that the path will be added later. An entry
|
||||||
for the path is placed in the index with no content. This is
|
for the path is placed in the index with no content. This is
|
||||||
useful for, among other things, showing the unstaged content of
|
useful for, among other things, showing the unstaged content of
|
||||||
such files with `git diff` and committing them with `git commit
|
such files with `git diff` and committing them with `git commit
|
||||||
-a`.
|
-a`.
|
||||||
|
|
||||||
--refresh::
|
`--refresh`::
|
||||||
Don't add the file(s), but only refresh their stat()
|
Don't add the file(s), but only refresh their stat()
|
||||||
information in the index.
|
information in the index.
|
||||||
|
|
||||||
--ignore-errors::
|
`--ignore-errors`::
|
||||||
If some files could not be added because of errors indexing
|
If some files could not be added because of errors indexing
|
||||||
them, do not abort the operation, but continue adding the
|
them, do not abort the operation, but continue adding the
|
||||||
others. The command shall still exit with non-zero status.
|
others. The command shall still exit with non-zero status.
|
||||||
The configuration variable `add.ignoreErrors` can be set to
|
The configuration variable `add.ignoreErrors` can be set to
|
||||||
true to make this the default behaviour.
|
true to make this the default behaviour.
|
||||||
|
|
||||||
--ignore-missing::
|
`--ignore-missing`::
|
||||||
This option can only be used together with --dry-run. By using
|
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
|
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
|
be ignored, no matter if they are already present in the work
|
||||||
tree or not.
|
tree or not.
|
||||||
|
|
||||||
--no-warn-embedded-repo::
|
`--no-warn-embedded-repo`::
|
||||||
By default, `git add` will warn when adding an embedded
|
By default, `git add` will warn when adding an embedded
|
||||||
repository to the index without using `git submodule add` to
|
repository to the index without using `git submodule add` to
|
||||||
create an entry in `.gitmodules`. This option will suppress the
|
create an entry in `.gitmodules`. This option will suppress the
|
||||||
warning (e.g., if you are manually performing operations on
|
warning (e.g., if you are manually performing operations on
|
||||||
submodules).
|
submodules).
|
||||||
|
|
||||||
--renormalize::
|
`--renormalize`::
|
||||||
Apply the "clean" process freshly to all tracked files to
|
Apply the "clean" process freshly to all tracked files to
|
||||||
forcibly add them again to the index. This is useful after
|
forcibly add them again to the index. This is useful after
|
||||||
changing `core.autocrlf` configuration or the `text` attribute
|
changing `core.autocrlf` configuration or the `text` attribute
|
||||||
in order to correct files added with wrong CRLF/LF line endings.
|
in order to correct files added with wrong _CRLF/LF_ line endings.
|
||||||
This option implies `-u`. Lone CR characters are untouched, thus
|
This option implies `-u`. Lone CR characters are untouched, thus
|
||||||
while a CRLF cleans to LF, a CRCRLF sequence is only partially
|
while a _CRLF_ cleans to _LF_, a _CRCRLF_ sequence is only partially
|
||||||
cleaned to CRLF.
|
cleaned to _CRLF_.
|
||||||
|
|
||||||
--chmod=(+|-)x::
|
`--chmod=(+|-)x`::
|
||||||
Override the executable bit of the added files. The executable
|
Override the executable bit of the added files. The executable
|
||||||
bit is only changed in the index, the files on disk are left
|
bit is only changed in the index, the files on disk are left
|
||||||
unchanged.
|
unchanged.
|
||||||
|
|
||||||
--pathspec-from-file=<file>::
|
`--pathspec-from-file=<file>`::
|
||||||
Pathspec is passed in _<file>_ instead of commandline args. If
|
Pathspec is passed in _<file>_ instead of commandline args. If
|
||||||
_<file>_ is exactly `-` then standard input is used. Pathspec
|
_<file>_ is exactly `-` then standard input is used. Pathspec
|
||||||
elements are separated by LF or CR/LF. Pathspec elements can be
|
elements are separated by _LF_ or _CR/LF_. Pathspec elements can be
|
||||||
quoted as explained for the configuration variable `core.quotePath`
|
quoted as explained for the configuration variable `core.quotePath`
|
||||||
(see linkgit:git-config[1]). See also `--pathspec-file-nul` and
|
(see linkgit:git-config[1]). See also `--pathspec-file-nul` and
|
||||||
global `--literal-pathspecs`.
|
global `--literal-pathspecs`.
|
||||||
|
|
||||||
--pathspec-file-nul::
|
`--pathspec-file-nul`::
|
||||||
Only meaningful with `--pathspec-from-file`. Pathspec elements are
|
Only meaningful with `--pathspec-from-file`. Pathspec elements are
|
||||||
separated with NUL character and all other characters are taken
|
separated with _NUL_ character and all other characters are taken
|
||||||
literally (including newlines and quotes).
|
literally (including newlines and quotes).
|
||||||
|
|
||||||
\--::
|
`--`::
|
||||||
This option can be used to separate command-line options from
|
This option can be used to separate command-line options from
|
||||||
the list of files, (useful when filenames might be mistaken
|
the list of files, (useful when filenames might be mistaken
|
||||||
for command-line options).
|
for command-line options).
|
||||||
@@ -219,18 +219,18 @@ for "git add --no-all _<pathspec>_...", i.e. ignored removed files.
|
|||||||
EXAMPLES
|
EXAMPLES
|
||||||
--------
|
--------
|
||||||
|
|
||||||
* Adds content from all `*.txt` files under `Documentation` directory
|
* Adds content from all ++*.txt++ files under `Documentation` directory
|
||||||
and its subdirectories:
|
and its subdirectories:
|
||||||
+
|
+
|
||||||
------------
|
------------
|
||||||
$ git add Documentation/\*.txt
|
$ git add Documentation/\*.txt
|
||||||
------------
|
------------
|
||||||
+
|
+
|
||||||
Note that the asterisk `*` is quoted from the shell in this
|
Note that the asterisk ++*++ is quoted from the shell in this
|
||||||
example; this lets the command include the files from
|
example; this lets the command include the files from
|
||||||
subdirectories of `Documentation/` directory.
|
subdirectories of `Documentation/` directory.
|
||||||
|
|
||||||
* Considers adding content from all git-*.sh scripts:
|
* Considers adding content from all ++git-*.sh++ scripts:
|
||||||
+
|
+
|
||||||
------------
|
------------
|
||||||
$ git add git-*.sh
|
$ git add git-*.sh
|
||||||
@@ -265,7 +265,7 @@ The main command loop has 6 subcommands (plus help and quit).
|
|||||||
|
|
||||||
status::
|
status::
|
||||||
|
|
||||||
This shows the change between HEAD and index (i.e. what will be
|
This shows the change between `HEAD` and index (i.e. what will be
|
||||||
committed if you say `git commit`), and between index and
|
committed if you say `git commit`), and between index and
|
||||||
working tree files (i.e. what you could stage further before
|
working tree files (i.e. what you could stage further before
|
||||||
`git commit` using `git add`) for each path. A sample output
|
`git commit` using `git add`) for each path. A sample output
|
||||||
@@ -277,12 +277,12 @@ status::
|
|||||||
2: +403/-35 +1/-1 add-interactive.c
|
2: +403/-35 +1/-1 add-interactive.c
|
||||||
------------
|
------------
|
||||||
+
|
+
|
||||||
It shows that foo.png has differences from HEAD (but that is
|
It shows that `foo.png` has differences from `HEAD` (but that is
|
||||||
binary so line count cannot be shown) and there is no
|
binary so line count cannot be shown) and there is no
|
||||||
difference between indexed copy and the working tree
|
difference between indexed copy and the working tree
|
||||||
version (if the working tree version were also different,
|
version (if the working tree version were also different,
|
||||||
'binary' would have been shown in place of 'nothing'). The
|
'binary' would have been shown in place of 'nothing'). The
|
||||||
other file, add-interactive.c, has 403 lines added
|
other file, `add-interactive.c`, has 403 lines added
|
||||||
and 35 lines deleted if you commit what is in the index, but
|
and 35 lines deleted if you commit what is in the index, but
|
||||||
working tree file has further modifications (one addition and
|
working tree file has further modifications (one addition and
|
||||||
one deletion).
|
one deletion).
|
||||||
@@ -360,7 +360,7 @@ variable `interactive.singleKey` to `true`.
|
|||||||
diff::
|
diff::
|
||||||
|
|
||||||
This lets you review what will be committed (i.e. between
|
This lets you review what will be committed (i.e. between
|
||||||
HEAD and index).
|
`HEAD` and index).
|
||||||
|
|
||||||
|
|
||||||
EDITING PATCHES
|
EDITING PATCHES
|
||||||
@@ -399,7 +399,7 @@ There are also more complex operations that can be performed. But beware
|
|||||||
that because the patch is applied only to the index and not the working
|
that because the patch is applied only to the index and not the working
|
||||||
tree, the working tree will appear to "undo" the change in the index.
|
tree, the working tree will appear to "undo" the change in the index.
|
||||||
For example, introducing a new line into the index that is in neither
|
For example, introducing a new line into the index that is in neither
|
||||||
the HEAD nor the working tree will stage the new line for commit, but
|
the `HEAD` nor the working tree will stage the new line for commit, but
|
||||||
the line will appear to be reverted in the working tree.
|
the line will appear to be reverted in the working tree.
|
||||||
|
|
||||||
Avoid using these constructs, or do so with extreme caution.
|
Avoid using these constructs, or do so with extreme caution.
|
||||||
@@ -439,6 +439,7 @@ CONFIGURATION
|
|||||||
|
|
||||||
include::includes/cmd-config-section-all.txt[]
|
include::includes/cmd-config-section-all.txt[]
|
||||||
|
|
||||||
|
:git-add: 1
|
||||||
include::config/add.txt[]
|
include::config/add.txt[]
|
||||||
|
|
||||||
SEE ALSO
|
SEE ALSO
|
||||||
|
|||||||
Reference in New Issue
Block a user