Skip to content

Commit 60e5236

Browse files
periperidipgitster
authored andcommitted
gitfaq: files in .gitignore are tracked
Add issue in 'Common Issues' section which addresses the problem of Git tracking files/paths mentioned in '.gitignore'. Signed-off-by: Shourya Shukla <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 07d8ea5 commit 60e5236

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

Documentation/gitfaq.txt

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -223,6 +223,16 @@ a file checked into the repository which is a template or set of defaults which
223223
can then be copied alongside and modified as appropriate. This second, modified
224224
file is usually ignored to prevent accidentally committing it.
225225

226+
[[files-in-.gitignore-are-tracked]]
227+
I asked Git to ignore various files, yet they are still tracked::
228+
A `gitignore` file ensures that certain file(s) which are not
229+
tracked by Git remain untracked. However, sometimes particular
230+
file(s) may have been tracked before adding them into the
231+
`.gitignore`, hence they still remain tracked. To untrack and
232+
ignore files/patterns, use `git rm --cached <file/pattern>`
233+
and add a pattern to `.gitignore` that matches the <file>.
234+
See linkgit:gitignore[5] for details.
235+
226236
Hooks
227237
-----
228238

0 commit comments

Comments
 (0)