Re: Combining/merging commits

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Johannes Sixt
Date: Monday, April 14, 2008 - 11:37 pm

xpr1010 schrieb:

Say, you have this commit series:

 ...--A--B--C--D

and you want to combine all of them, i.e. the last 4 commits, into a new
one, then you can do:

    # undo commits, but leave working directory unchanged
    $ git reset HEAD~4
    # make a new commit
    $ git commit

But if you want to combine only A,B,C because D should remain a separate
commit (i.e. what you want to combine are *not* the last commits), then
use git rebase --interactive, in particular, the 'squash' instruction. You
would use this todo list:

    pick A
    squash B
    squash C
    pick D

-- Hannes

--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
Combining/merging commits, xpr1010, (Mon Apr 14, 5:57 pm)
Re: Combining/merging commits, Johannes Sixt, (Mon Apr 14, 11:37 pm)
Re: Combining/merging commits, xpr1010, (Tue Apr 15, 5:43 am)