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

[PATCH] Add 'rm -f' equivalent to 'git rm' example of filter-branch --index-filter

From
Jacob Helwig <jacob.helwig@gmail.com>
Date
Feb 12, 2009, 18:01 UTC
Message-ID
<1234461670-25657-1-git-send-email-jacob.helwig@gmail.com>
In-Reply-To
<AB13D1C5-4464-49B5-8314-FCB1E249BF22@semanticart.com>
Signed-off-by: Jacob Helwig <jacob.helwig@gmail.com>
---
 Documentation/git-filter-branch.txt |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)
diff --git a/Documentation/git-filter-branch.txt b/Documentation/git-filter-branch.txt
index 451950b..1fbbbb4 100644
--- a/Documentation/git-filter-branch.txt
+++ b/Documentation/git-filter-branch.txt
@@ -212,6 +212,11 @@ git filter-branch --index-filter 'git rm --cached filename' HEAD
 
 Now, you will get the rewritten history saved in HEAD.
 
+As with using `rm filename`, `git rm --cached filename` will fail
+if the file is absent from the tree of a commit.  If it is not important
+whether the file is already absent from the tree, you can use
+`git rm --cached --ignore-unmatch filename` instead.
+
 To rewrite the repository to look as if `foodir/` had been its project
 root, and discard all other history:
 
-- 
1.6.1.1
Previous: Jeffrey ChuppNext: Junio C Hamano
Message 2 of 4 in “git filter-branch examples on man page are outdated”
  1. Jeffrey ChuppFeb 12, 2009
  2. Add 'rm -f' equivalent to 'git rm' example of filter-branch --index-filterJacob Helwig, Feb 12, 2009
  3. Junio C HamanoFeb 12, 2009
  4. Johannes SchindelinFeb 12, 2009

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.