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

[PATCH] docs: clarify git rm --cached function in gitignore note

From
SGSohom Datta via GitGitGadget <gitgitgadget@gmail.com>
Date
Oct 5, 2020, 08:58 UTC
Message-ID
<pull.862.git.git.1601888338644.gitgitgadget@gmail.com>
From: Sohom <sohom.datta@learner.manipal.edu>

Added text explaining that the git rm --cached command isn't analogous to the gitignore file and that the file will need to be added to gitignore to prevent later commits from adding the file back.

Signed-off-by: Sohom Datta <sohom.datta@learner.manipal.edu>
---
    docs: Clarify git rm --cached function in gitignore note
    
    Added text explaining that the git rm --cached command isn't analogous
    to the gitignore file and that the file will need to be added to 
    gitignore to prevent later commits from adding the file back.
Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-git-862%2Fsohomdatta1%2Fgitignore-note-v1
Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-git-862/sohomdatta1/gitignore-note-v1
Pull-Request: https://github.com/git/git/pull/862
 Documentation/gitignore.txt | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/Documentation/gitignore.txt b/Documentation/gitignore.txt
index d47b1ae296..22d58df805 100644
--- a/Documentation/gitignore.txt
+++ b/Documentation/gitignore.txt
@@ -147,7 +147,9 @@ The purpose of gitignore files is to ensure that certain files
 not tracked by Git remain untracked.
 
 To stop tracking a file that is currently tracked, use
-'git rm --cached'.
+'git rm --cached' to remove the file from the index. The filename
+can then be added to the `gitignore` file to stop the file from
+being reintroduced in later commits.
 
 EXAMPLES
 --------

base-commit: ab4691b67bc1a2cd8d9068fb03e3fbd6979247d6
-- 
gitgitgadget
Next: Sohom
Message 1 of 7 in “docs: clarify git rm --cached function in gitignore note”
  1. docs: clarify git rm --cached function in gitignore noteSohom Datta via GitGitGadget, Oct 5, 2020
  2. SohomMay 3, 2023
  3. Elijah NewrenMay 3, 2023
  4. docs: clarify git rm --cached function in gitignore noteSohom Datta via GitGitGadget, May 3, 2023
  5. Junio C HamanoMay 3, 2023
  6. docs: clarify git rm --cached function in gitignore noteSohom Datta via GitGitGadget, May 3, 2023
  7. Elijah NewrenMay 7, 2023

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.