home | list info | list archive | date index | thread index

Re: [OCLUG-Tech] git question: how can i drop the n'th last commit?

  • Subject: Re: [OCLUG-Tech] git question: how can i drop the n'th last commit?
  • From: Alex Pilon <alp [ at ] alexpilon [ dot ] ca>
  • Date: Mon, 16 May 2016 09:16:29 -0400
On Mon, May 16, 2016 at 06:57:51AM -0400, Robert P. J. Day wrote:
> i'm assuming that i can use a combination of cherry picking and
> rebasing to "extract" any linear sequence of commits from a branch if
> i decide they properly belonged elsewhere.
>
> is it just me, or do other people think this is a useful operation?
> and is there an even simpler way to do it?

If too many commits, checkout -b a new branch, rebase interactive onto
where you want the commits, picking only where you want those, then
check out the new rebase point, and fast forward merge onto your new
branch.