# Error in git-cherry-pick manpage?

2 messages from 2008-11-14 to 2008-11-18. Participants: Jens Seidel, Pete Harlan.
Thread: https://gitlist.dev/t/16329

## Jens Seidel, 2008-11-14 15:14

Subject: Error in git-cherry-pick manpage?
Message-ID: <20081114151426.GA20985@merkur.sol.de>
URL: https://gitlist.dev/e/20081114151426.GA20985%40merkur.sol.de

```
Hi,

I try to use git cherry-pick to combine multiple commits but I'm confused
about the second sentence of the description:

"Given one existing commit, apply the change the patch introduces, and
record a new commit that records it. This requires your working tree to be
clean (no modifications from the HEAD commit)."

I intent to use it as follows:

 git cherry-pick -x --no-commit 2e855ae
 git cherry-pick -x --no-commit 0c1151
 ...

After the first invocation my working tree will not be clean but contain
changes in the index.

Does this mean that's a wrong usage of cherry-pick?

Jens

```

## Pete Harlan, 2008-11-18 19:34

Subject: Re: Error in git-cherry-pick manpage?
Message-ID: <492318AF.8080004@pcharlan.com>
URL: https://gitlist.dev/e/492318AF.8080004%40pcharlan.com
In-Reply-To: <20081114151426.GA20985@merkur.sol.de>

```
Jens Seidel wrote:
> Hi,
> 
> I try to use git cherry-pick to combine multiple commits but I'm confused
> about the second sentence of the description:
> 
> "Given one existing commit, apply the change the patch introduces, and
> record a new commit that records it. This requires your working tree to be
> clean (no modifications from the HEAD commit)."
> 
> I intent to use it as follows:
> 
>  git cherry-pick -x --no-commit 2e855ae
>  git cherry-pick -x --no-commit 0c1151
>  ...
> 
> After the first invocation my working tree will not be clean but contain
> changes in the index.
> 
> Does this mean that's a wrong usage of cherry-pick?

If it is, you might try this:

  git cherry-pick -x 2e855ae             # Let it commit
  git cherry-pick -x --no-commit 0c1151  # Will stage changes
  git commit --amend
  # Repeat last two steps as needed...

--Pete

```
