Matthias Lederhofer  committed ff4d780

Documentation about exclude/ignore files

Use .git/info/exclude in the example in git-ls-files.txt,
instead of .git/ignore, and update the list of commands looking
at .git/info/exclude in repository-layout.txt.

Signed-off-by: Matthias Lederhofer <>
Signed-off-by: Junio C Hamano <>

  • Participants
  • Parent commits a526276

Comments (0)

Files changed (2)

File Documentation/git-ls-files.txt

 An example:
-    $ cat .git/ignore
+    $ cat .git/info/exclude
     # ignore objects and archives, anywhere in the tree.
     $ cat Documentation/.gitignore
     $ git-ls-files --ignored \
         --exclude='Documentation/*.[0-9]' \
-        --exclude-from=.git/ignore \
+        --exclude-from=.git/info/exclude \

File Documentation/repository-layout.txt

 	This file, by convention among Porcelains, stores the
-	exclude pattern list.  `git status` looks at it, but
-	otherwise it is not looked at by any of the core git
-	commands.
+	exclude pattern list. `.gitignore` is the per-directory
+	ignore file.  `git status`, `git add`, `git rm` and `git
+	clean` look at it but the core git commands do not look
+	at it.  See also: gitlink:git-ls-files[1] `--exclude-from`
+	and `--exclude-per-directory`.
 	Stores shorthands to be used to give URL and default