# How about cherry-pick --squash?

3 messages from 2008-03-14 to 2008-03-14. Participants: Ping Yin, Sean.
Thread: https://gitlist.dev/t/12692

## Ping Yin, 2008-03-14 15:15

Subject: How about cherry-pick --squash?
Message-ID: <46dff0320803140815q5a342f5fjdde02c6b5fde4e5f@mail.gmail.com>
URL: https://gitlist.dev/e/46dff0320803140815q5a342f5fjdde02c6b5fde4e5f%40mail.gmail.com

```
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, 2008-03-14 15:25

Subject: Re: How about cherry-pick --squash?
Message-ID: <BAYC1-PASMTP015BC6B5B35F790E097CBEAE0A0@CEZ.ICE>
URL: https://gitlist.dev/e/BAYC1-PASMTP015BC6B5B35F790E097CBEAE0A0%40CEZ.ICE
In-Reply-To: <46dff0320803140815q5a342f5fjdde02c6b5fde4e5f@mail.gmail.com>

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

> 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, 2008-03-14 15:32

Subject: Re: How about cherry-pick --squash?
Message-ID: <46dff0320803140832x596047c0yb5c81f0f9b8d186d@mail.gmail.com>
URL: https://gitlist.dev/e/46dff0320803140832x596047c0yb5c81f0f9b8d186d%40mail.gmail.com
In-Reply-To: <BAYC1-PASMTP015BC6B5B35F790E097CBEAE0A0@CEZ.ICE>

```
On Fri, Mar 14, 2008 at 11:25 PM, Sean <seanlkml@sympatico.ca> wrote:
> 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

```
