3

This question is extremely similar to this one but with the caveat that I need to remove all previous versions of the file including renamed versions. Basically I'm looking for the solution found here but including the fact that maybe 6 months ago I renamed "Rakefile_test" to "Rakefile" and "Rakefile_test" must be removed from the Git history as well.

To clarify: I do not know which files have been renamed or what their old names were.

Community
  • 1
  • 1
Rotsiser Mho
  • 551
  • 2
  • 5
  • 19

1 Answers1

0

Simply remove both files (assuming that there wasn't a different file with the same name before the rename):

git filter-branch --index-filter 'git rm --cached --ignore-unmatch Rakefile Rakefile_test' \
  --prune-empty --tag-name-filter cat -- --all
knittl
  • 246,190
  • 53
  • 318
  • 364
  • Yes, that would work. But I don't know which files have been renamed. I only know the name of the file as it is at the head of the branch. – Rotsiser Mho Aug 20 '12 at 17:29
  • 1
    @Rotsiser Give up. Git doesn't track renames, it *detects* them. The necessary information for this task isn't even in the repository. – alternative Aug 20 '12 at 18:04
  • 1
    Ha, I'm not in the habit of giving up. I assume this task is possible since `git log --follow` can come up with the required information (I think). – Rotsiser Mho Aug 20 '12 at 18:40