Skip to content

Commit 4b5f94c

Browse files
committed
Merge branch 'jn/ignore-doc' into maint
* jn/ignore-doc: Documentation: point to related commands from gitignore Documentation: split gitignore page into sections
2 parents 6aa6a92 + 6f02a5a commit 4b5f94c

File tree

1 file changed

+23
-7
lines changed

1 file changed

+23
-7
lines changed

Documentation/gitignore.txt

Lines changed: 23 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,8 @@ DESCRIPTION
1414

1515
A `gitignore` file specifies intentionally untracked files that
1616
git should ignore.
17-
Note that all the `gitignore` files really concern only files
18-
that are not already tracked by git;
19-
in order to ignore uncommitted changes in already tracked files,
20-
please refer to the 'git update-index --assume-unchanged'
21-
documentation.
17+
Files already tracked by git are not affected; see the NOTES
18+
below for details.
2219

2320
Each line in a `gitignore` file specifies a pattern.
2421
When deciding whether to ignore a path, git normally checks
@@ -62,7 +59,8 @@ files specified by command-line options. Higher-level git
6259
tools, such as 'git status' and 'git add',
6360
use patterns from the sources specified above.
6461

65-
Patterns have the following format:
62+
PATTERN FORMAT
63+
--------------
6664

6765
- A blank line matches no files, so it can serve as a separator
6866
for readability.
@@ -98,7 +96,20 @@ Patterns have the following format:
9896
For example, "/{asterisk}.c" matches "cat-file.c" but not
9997
"mozilla-sha1/sha1.c".
10098

101-
An example:
99+
NOTES
100+
-----
101+
102+
The purpose of gitignore files is to ensure that certain files
103+
not tracked by git remain untracked.
104+
105+
To ignore uncommitted changes in a file that is already tracked,
106+
use 'git update-index {litdd}assume-unchanged'.
107+
108+
To stop tracking a file that is currently tracked, use
109+
'git rm --cached'.
110+
111+
EXAMPLES
112+
--------
102113

103114
--------------------------------------------------------------
104115
$ git status
@@ -140,6 +151,11 @@ Another example:
140151
The second .gitignore prevents git from ignoring
141152
`arch/foo/kernel/vmlinux.lds.S`.
142153

154+
SEE ALSO
155+
--------
156+
linkgit:git-rm[1], linkgit:git-update-index[1],
157+
linkgit:gitrepository-layout[5]
158+
143159
Documentation
144160
-------------
145161
Documentation by David Greaves, Junio C Hamano, Josh Triplett,

0 commit comments

Comments
 (0)