From: Jakub Narebski Date: Wed, 07 Feb 2007 10:25:41 GMT Subject: Re: [PATCH] Show an example of deleting commits with git-rebase. Message-ID: In-Reply-To: <20070207101624.GC20290@mellanox.co.il> Michael S. Tsirkin wrote: > Shawn O. Pearce wrote: >> Subject: [PATCH] Show an example of deleting commits with git-rebase. >> >> +A range of commits could also be removed with rebase. If we have >> +the following situation: >> + >> +------------ >> + E---F---G---H---I---J topicA >> +------------ >> + >> +then the command >> + >> + git-rebase --onto topicA~5 topicA~2 topicA >> + >> +would result in the removal of commits F and G: >> + >> +------------ >> + E---H'---I'---J' topicA >> +------------ >> + >> +This is useful if F and G were flawed in some way, or should not be >> +part of topicA. Note that the argument to --onto and the >> +parameter can be any valid commit-ish. >> + > > Good clarification, a couple of comments: > - The use of is more confusing than useful in this case. > You can always just do > git reset --hard topicA > git rebase --onto topicA~5 topicA~2 > instead, correct? I disagree. In my opinion using of makes it more clear: which branch we are rebasing, and range of commits moved. > - The use of ~ notation here is also more scary than clarifying. > git rebase --onto F H > will be clearer I think. I agree. -- Jakub Narebski Warsaw, Poland ShadeHawk on #git