tags:

views:

75

answers:

1

I noticed recently that the project files my text editors use (along with some other junk) got added the git repository for the project. Since they aren't actually part of the project, I'd like to remove them, but git rm doesnt remove the old versions from the repository, and I couldnt find anything else that looks promising.

+4  A: 

The tool you want is git filter-branch. Its usage is described here, but basically:

$ git filter-branch --tree-filter 'rm -f my_file' HEAD

will remove "my_file" from every commit.

Notice that this rewrites every commit, so if you push into a remote repository, you have to (a) force the update, and (b) everyone else who pulled from you will now have duplicate commits (since you rewrote the history), as described on the git rebase man page.

mipadi
Yeah, im not sure how i missed that command, thanks for pointing it out.
David X