Skip to content

Commit 49bde75

Browse files
jhelwiggitster
authored andcommitted
Add 'rm -f' equivalent to 'git rm' example of filter-branch --index-filter
Signed-off-by: Jacob Helwig <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 222b167 commit 49bde75

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

Documentation/git-filter-branch.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -212,6 +212,11 @@ git filter-branch --index-filter 'git rm --cached filename' HEAD
212212

213213
Now, you will get the rewritten history saved in HEAD.
214214

215+
As with using `rm filename`, `git rm --cached filename` will fail
216+
if the file is absent from the tree of a commit. If it is not important
217+
whether the file is already absent from the tree, you can use
218+
`git rm --cached --ignore-unmatch filename` instead.
219+
215220
To rewrite the repository to look as if `foodir/` had been its project
216221
root, and discard all other history:
217222

0 commit comments

Comments
 (0)