Using GIT for backup. How to permanently remove deleted files from old revisions

backupgit

I'm using git for keeping all my sites backup here.
It works very well, I can jump in and out of a expecific backup with a command.

The problem is, this is incremental. Even if I exclude a file now, it will still be there in the old revisions. This is good, but there are some big files, like sql backups, that I dont need to keep all the history.

As I backup my database everyday, in a different file name, I'm running out of space =p

How can I permanently remove old/deleted files from my git repository?

Best Answer

Use git filter-branch. An example from the manpage:

git filter-branch --index-filter 'git rm --cached --ignore-unmatch filename' HEAD