git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH] Documentation/gitignore.txt: Clarify gitignore vs tracked files

From
Petr Baudis <pasky@suse.cz>
Date
Jul 17, 2008, 16:36 UTC
Message-ID
<20080717163622.12592.29919.stgit@localhost>

Explain more carefully that `.gitignore` concerns only untracked files and there is no way to make git ignore local changes in already tracked files.

This is currently probably one of the top FAQs at #git and the documentation could be more explicit about this.

Signed-off-by: Petr Baudis <pasky@suse.cz>
---
 Documentation/gitignore.txt |    7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)
diff --git a/Documentation/gitignore.txt b/Documentation/gitignore.txt
index fc0efd8..ac3c776 100644
--- a/Documentation/gitignore.txt
+++ b/Documentation/gitignore.txt
@@ -13,9 +13,12 @@ DESCRIPTION
 -----------
 
 A `gitignore` file specifies intentionally untracked files that
-git should ignore.  Each line in a `gitignore` file specifies a
-pattern.
+git should ignore.
+Note that all the `gitignore` files really concern only files
+that are not already tracked by git; there is no direct mechanism
+to make git ignore your local modifications in already tracked files.
 
+Each line in a `gitignore` file specifies a pattern.
 When deciding whether to ignore a path, git normally checks
 `gitignore` patterns from multiple sources, with the following
 order of precedence, from highest to lowest (within one level of
Next: Junio C Hamano
Message 1 of 4 in “Documentation/gitignore.txt: Clarify gitignore vs tracked files”
  1. Documentation/gitignore.txt: Clarify gitignore vs tracked filesPetr Baudis, Jul 17, 2008
  2. Junio C HamanoJul 17, 2008
  3. Petr BaudisJul 17, 2008
  4. Documentation: How to ignore local changes in tracked filesPetr Baudis, Jul 18, 2008

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.