How to remove unneeded files from a git repo
10/04/14Tagged with git, puppet
This is the distilled information from these two excellent blog posts:
First list all the files with the repository with
git rev-list --objects --all | sort -k 2 > allfiles.txt
or if you would like to list unique files
git rev-list --objects --all | sort -k 2 | cut -f 2 -d\ | uniq
Found a file/directory you would like to completely wipe from the repository?
Execute
git filter-branch --index-filter 'git rm -rf --cached --ignore-unmatch directory/' -- --all
but be careful, this might eat your beloved cat!