Domanda

I did this:

git filter-branch --tree-filter '~/fix-lines.sh' -d /dev/shm/repo-temp \
--tag-name-filter cat --prune-empty -- --all

Basically fixing some line ending issues. (some 793 commits were rewritten). Then I realized hey, I might as well convert my tabs to 4 spaces. So I did this:

git filter-branch --tree-filter '~/fix-tabs.sh' -d /dev/shm/repo-temp \
--tag-name-filter cat --prune-empty -- --all

Now I am going through 1594 commit objects (some new were added).

Apparently my entire old tree is still somewhere in git repo? If so, how do I get rid of it and how do I check that it is gone? I only want to keep the "original" rewritten ~800 commits, and no more.

È stato utile?

Soluzione

Check for tags you may have created that may keep the old tree from being garbage-collected.
Namely, git-filter-branch leaves tags on the original tree untouched and does not auto-move them to the new tree.

To get rid of it I did things like

git push . :refs/original/refs/tags/v1.0.x
git push origin :refs/original/refs/tags/v1.0.5

until all original and extra tags were gone

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top