aboutsummaryrefslogtreecommitdiff
path: root/Documentation/git-add.txt
diff options
context:
space:
mode:
authorJunio C Hamano <junkio@cox.net>2006-12-25 03:13:45 -0800
committerJunio C Hamano <junkio@cox.net>2006-12-25 03:29:08 -0800
commite23ca9e1f95a756bfe598568be9d03059db1dad2 (patch)
treeab1e60a204db751935224bfae53db6709a9e46ad /Documentation/git-add.txt
parent4888c534099012d71d24051deb5b14319747bd1a (diff)
downloadgit-e23ca9e1f95a756bfe598568be9d03059db1dad2.tar.gz
git-e23ca9e1f95a756bfe598568be9d03059db1dad2.tar.xz
git-add: add ignored files when asked explicitly.
One thing many people found confusing about git-add was that a file whose name matches an ignored pattern could not be added to the index. With this, such a file can be added by explicitly spelling its name to git-add. Fileglobs and recursive behaviour do not add ignored files to the index. That is, if a pattern '*.o' is in .gitignore, and two files foo.o, bar/baz.o are in the working tree: $ git add foo.o $ git add '*.o' $ git add bar Only the first form adds foo.o to the index. Signed-off-by: Junio C Hamano <junkio@cox.net>
Diffstat (limited to 'Documentation/git-add.txt')
-rw-r--r--Documentation/git-add.txt11
1 files changed, 8 insertions, 3 deletions
diff --git a/Documentation/git-add.txt b/Documentation/git-add.txt
index 8710b3a75..2fef0681b 100644
--- a/Documentation/git-add.txt
+++ b/Documentation/git-add.txt
@@ -25,8 +25,9 @@ the commit.
The 'git status' command can be used to obtain a summary of what is included
for the next commit.
-This command only adds non-ignored files, to add ignored files use
-"git update-index --add".
+This command can be used to add ignored files, but they have to be
+explicitly and exactly specified from the command line. File globbing
+and recursive behaviour do not add ignored files.
Please see gitlink:git-commit[1] for alternative ways to add content to a
commit.
@@ -35,7 +36,11 @@ commit.
OPTIONS
-------
<file>...::
- Files to add content from.
+ 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 add all files in the
+ directory, recursively.
-n::
Don't actually add the file(s), just show if they exist.