More Fun with 'git filter-branch'
Previously, I covered the use of the git filter-branch for removing large media assets from a repository’s history. Recently I had a new opportunity to perform this task on whole directories. Here is the command sequence I used to clean up the repo history and to shrink the pack file: # Remove a directory from history in all branches and tags $ git filter-branch --index-filter 'git rm -r --cached --ignore-unmatch path/to/dir' --tag-name-filter cat -- --all # Shrink the local pack $ rm -Rf ....