Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>The core thing you're going to want here is <code>git add -p</code> (<code>-p</code> is a synonym for <code>--patch</code>). This provides an interactive way to check in content, letting you decide whether each hunk should go in, and even letting you manually edit the patch if necessary.</p> <p>To use it in combination with cherry-pick:</p> <pre><code>git cherry-pick -n &lt;commit&gt; # get your patch, but don't commit (-n = --no-commit) git reset # unstage the changes from the cherry-picked commit git add -p # make all your choices (add the changes you do want) git commit # make the commit! </code></pre> <p>(Thanks to Tim Henigan for reminding me that git-cherry-pick has a --no-commit option, and thanks to Felix Rabe for pointing out that you need to reset! If you only want to leave a few things out of the commit, you could use <code>git reset &lt;path&gt;...</code> to unstage just those files.)</p> <p>You can of course provide specific paths to <code>add -p</code> if necessary. If you're starting with a patch you could replace the <code>cherry-pick</code> with <code>apply</code>.</p> <hr> <p>If you really want a <code>git cherry-pick -p &lt;commit&gt;</code> (that option does not exist), your can use</p> <pre><code>git checkout -p &lt;commit&gt; </code></pre> <p>That will diff the current commit against the commit you specify, and allow you to apply hunks from that diff individually. This option may be more useful if the commit you're pulling in has merge conflicts in part of the commit you're not interested in. (Note, however, that <code>checkout</code> differs from <code>cherry-pick</code>: <code>checkout</code> tries to apply <code>&lt;commit&gt;</code>'s contents entirely, <code>cherry-pick</code> applies the diff of the specified commit from it's parent. This means that <code>checkout</code> can apply more than just that commit, which might be more than you want.)</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload