How can I remove the complete history of anything on any branch but the files currently existing on HEAD (my master branch)?
I have been doing things like
git filter-branch -f --prune-empty --index-filter \
"git rm -rf --cached --ignore-unmatch '*.js' '*.html' '*.css'" \
HEAD
but this is getting tedious, since I have to make explicit what to remove, not what to keep.
Git in principle should be able to determine all ancestors of current files, go back in history, and remove everything thats not in the ancestors. How?
I gave up: this whole rewriting of history seems to be very brittle and messes up things. It sucks. I just copy over files and bite the bullet of loosing history.