Skip to content

Commit ff4d780

Browse files
matledJunio C Hamano
authored andcommitted
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent a526276 commit ff4d780

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

Documentation/git-ls-files.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@ An exclude pattern is of the following format:
207207
An example:
208208

209209
--------------------------------------------------------------
210-
$ cat .git/ignore
210+
$ cat .git/info/exclude
211211
# ignore objects and archives, anywhere in the tree.
212212
*.[oa]
213213
$ cat Documentation/.gitignore
@@ -217,7 +217,7 @@ An example:
217217
!foo.html
218218
$ git-ls-files --ignored \
219219
--exclude='Documentation/*.[0-9]' \
220-
--exclude-from=.git/ignore \
220+
--exclude-from=.git/info/exclude \
221221
--exclude-per-directory=.gitignore
222222
--------------------------------------------------------------
223223

Documentation/repository-layout.txt

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -120,9 +120,11 @@ info/grafts::
120120

121121
info/exclude::
122122
This file, by convention among Porcelains, stores the
123-
exclude pattern list. `git status` looks at it, but
124-
otherwise it is not looked at by any of the core git
125-
commands.
123+
exclude pattern list. `.gitignore` is the per-directory
124+
ignore file. `git status`, `git add`, `git rm` and `git
125+
clean` look at it but the core git commands do not look
126+
at it. See also: gitlink:git-ls-files[1] `--exclude-from`
127+
and `--exclude-per-directory`.
126128

127129
remotes::
128130
Stores shorthands to be used to give URL and default

0 commit comments

Comments
 (0)