Skip to content

Commit 3f4ab61

Browse files
committed
doc: git-add: simplify discussion of ignored files
- Mention the --force option earlier - Remove the explanation of shell globbing vs git's internal glob system, it's a common gotcha but I don't think this is an appropriate place to explain that concept. There's some discussion of the gotchas around globbing and `git add` in the EXAMPLES section which I think is clearer. Signed-off-by: Julia Evans <[email protected]>
1 parent 310d2c1 commit 3f4ab61

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

Documentation/git-add.adoc

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -34,12 +34,11 @@ you must run `git add` again to add the new content to the index.
3434
The `git status` command can be used to obtain a summary of which
3535
files have changes that are staged for the next commit.
3636

37-
The `git add` command will not add ignored files by default. If any
38-
ignored files were explicitly specified on the command line, `git add`
39-
will fail with a list of ignored files. Ignored files reached by
40-
directory recursion or filename globbing performed by Git (quote your
41-
globs before the shell) will be silently ignored. The `git add` command can
42-
be used to add ignored files with the `-f` (force) option.
37+
`git add` will not add ignored files by default. You can use the
38+
`--force` option to add ignored files. If you explicitly specify the
39+
exact filename of an ignored file (e.g. `git add ignored.txt`), `git
40+
add` will fail with a list of ignored files. Otherwise it will silently
41+
ignore the file.
4342

4443
OPTIONS
4544
-------

0 commit comments

Comments
 (0)