threads / discuss / 12692

How about cherry-pick --squash?

Subject: How about cherry-pick --squash?

## tl;dr

3 messages between Mar 14, 2008 and Mar 14, 2008.

replies: 2people: 2as markdown or json

Ping Yin· Mar 14, 2008, 15:15 UTC · lore

Sometimes i want to cherry pick a commit, but i don't want the commit message of this commit. What i want is the patch corresponding to this commit to be squashed to the top commit?

Now i have to type
git format-patch -1 --stdout  <sha1> | git apply --index && git commit --amend
How about
git cherry-pick --squash <sha1>
-- 
Ping Yin
Sean· Mar 14, 2008, 15:25 UTC · re: Ping Yin · lore

Re: How about cherry-pick --squash?

On Fri, 14 Mar 2008 23:15:32 +0800 "Ping Yin" <pkufranky@gmail.com> wrote:

Show 7 quoted lines
> Sometimes i want to cherry pick a commit, but i don't want the commit
> message of this commit. What i  want is the patch corresponding to
> this commit to be squashed to the top commit?
> 
> Now i have to type
> 
> git format-patch -1 --stdout  <sha1> | git apply --index && git commit --amend
Hi Ping,
There is an easier way:

$ git cherry-pick -n <sha1> $ git commit -a --amend

HTH, Sean

Ping Yin· Mar 14, 2008, 15:32 UTC · re: Sean · lore

Re: How about cherry-pick --squash?

On Fri, Mar 14, 2008 at 11:25 PM, Sean <seanlkml@sympatico.ca> wrote:
Show 9 quoted lines
> On Fri, 14 Mar 2008 23:15:32 +0800
>  "Ping Yin" <pkufranky@gmail.com> wrote:
>
>
>  There is an easier way:
>
>  $  git cherry-pick -n <sha1>
>  $  git commit -a --amend
>
Thanks, it's simpler.
-- 
Ping Yin

← back to recent threads