Search Results Matching Your Query: Zero
Git prune doesn't remove as much as I'd like

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:

mkdir newrepo
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?

One response to “Git prune doesn't remove as much as I'd like”

  1. Stackoverflow

    This question was also posted to Stackoverflow, here.

    Submitted by dave