Re: Trying to use git-filter-branch to compress history by removing large, obsolete binary files
- From
Elijah Newren <newren@gmail.com>
- Date
- Oct 8, 2007, 00:22 UTC
- Message-ID
- <51419b2c0710071722k576c06d9i2f4dce730eae2059@mail.gmail.com>
- In-Reply-To
- <20071007234346.GA29433@potapov>
On 10/7/07, Dmitry Potapov <dpotapov@gmail.com> wrote:
Show 8 quoted lines
> On Sun, Oct 07, 2007 at 04:24:49PM -0600, Elijah Newren wrote: > > $ git reflog expire --all > > $ git gc --aggressive --prune > > I believe this should work: > > git reflog expire --all --expire-unreachable=0 > git gc --prune
Yes, this seems to work. So the history-rewriting steps are
git-filter-branch --tree-filter 'rm -f testme.txt' HEAD git reset --hard rm -rf .git/refs/original/ vi .git/packed-refs # Use vi to remove the line referring to refs/original... git reflog expire --all --expire-unreachable=0 git gc --prune
Seems like a wrapper is needed. :-)
> Warning: all unreachable references will be removed!
What other scenarios could lead to unreachable references? I don't know how to determine whether this is safe or not (except that these were test repositories anyway, so I don't care what happens to them).
Thanks! Elijah