]> git.ipfire.org Git - thirdparty/git.git/commitdiff
gitfaq: files in .gitignore are tracked
authorShourya Shukla <shouryashukla.oo@gmail.com>
Wed, 6 May 2020 08:00:20 +0000 (13:30 +0530)
committerJunio C Hamano <gitster@pobox.com>
Wed, 6 May 2020 18:12:22 +0000 (11:12 -0700)
Add issue in 'Common Issues' section which addresses the problem of
Git tracking files/paths mentioned in '.gitignore'.

Signed-off-by: Shourya Shukla <shouryashukla.oo@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Documentation/gitfaq.txt

index 1cf83df118a52374562c397857e5e010a6a0a48c..11d9bac85901fe3cf36cf3f2f9cbba9468093cb9 100644 (file)
@@ -223,6 +223,16 @@ a file checked into the repository which is a template or set of defaults which
 can then be copied alongside and modified as appropriate.  This second, modified
 file is usually ignored to prevent accidentally committing it.
 
+[[files-in-.gitignore-are-tracked]]
+I asked Git to ignore various files, yet they are still tracked::
+       A `gitignore` file ensures that certain file(s) which are not
+       tracked by Git remain untracked.  However, sometimes particular
+       file(s) may have been tracked before adding them into the
+       `.gitignore`, hence they still remain tracked.  To untrack and
+       ignore files/patterns, use `git rm --cached <file/pattern>`
+       and add a pattern to `.gitignore` that matches the <file>.
+       See linkgit:gitignore[5] for details.
+
 Hooks
 -----