I have a testcase shell script. I want to completely remove the history of some subdirectories in my git repositoiry, but I can't figure out how.
I thought that I could fool git by creating a new repo and only merging the files that I want to keep:
git init; touch README; git add .; git commit -m "initial"
git remote add oldrepo /path/to/oldrepo
git merge -s ours --no-commit
git read-tree --prefix=subdir1 -u
git commit -m "merged subdir1"
git remote rm oldrepo
git prune --verbose
Unfortunately, the prune command prunes nothing. I was hoping that it would prune every object that had never been a child of SUBDIR1-TREE. Is there a way to do what I want?