Purging parts of a branch's history?
talden at gmail.com
Tue Aug 12 22:56:56 BST 2008
>>> | Is it possible to remove parts of the history from a bzr branch? I
>> Yes, you generally would have to use 'bzr-rebase' to prune bits of history.
>> I don't have an exact recipe for you, but something like:
>> bzr init new_branch
>> cd new_branch
>> bzr pull -r XX ../old_branch (pull whatever you think is *good* to keep)
>> bzr rebase -r YY..ZZ ../old_branch
>> Or something along those lines.
> I still can't figure out how to do what I want. Just to clarify, I only want
> to remove parts of the history, not the actual content - i.e. I want to loose
> the first X commit message (they are total nonsense).
> After re-reading the documentation of rebase, AFAIK, it can only "move" the
> changesets around, not remove history metadata while preserving the content.
AIUI rebase doesn't move revisions around, it combines them into a new revision.
So you can collapse the 100 revisions into 1. This of course break
history which breaks any branches and checkouts that are dependent on
Let's say you have the revisions [A, B , C, D] and you no longer care
about the individual details (committers, time, order, changes and log
message) of A, B and C. You could rebase to get [X, D] where X is a
single new revision that represents the patch of iteratively applying
A, B and C.
More information about the bazaar