From: Jacob Helwig Date: Thu, 12 Feb 2009 18:01:10 +0000 (-0800) Subject: Add 'rm -f' equivalent to 'git rm' example of filter-branch --index-filter X-Git-Tag: v1.6.2-rc1~21 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=49bde7533681f5e4a80402af465bd7a28556266e;p=git.git Add 'rm -f' equivalent to 'git rm' example of filter-branch --index-filter Signed-off-by: Jacob Helwig Signed-off-by: Junio C Hamano --- diff --git a/Documentation/git-filter-branch.txt b/Documentation/git-filter-branch.txt index 451950bab..1fbbbb402 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: