Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>You can also use <code>git cherry-pick</code> for this:</p> <pre><code>$ g # g is my alias for git log --all --decorate --oneline --graph --color * 618f8e5 [2013-12-14 15:13] (HEAD, master) me: good 6 * e27d6d7 [2013-12-14 15:13] me: good 5 * 533f6c3 [2013-12-14 15:13] me: good 4 * 877585f [2013-12-14 15:13] me: bad * 00c06f3 [2013-12-14 15:12] me: good 3 * e9f80a4 [2013-12-14 15:12] me: good 2 * 3122ba7 [2013-12-14 15:12] me: good 1 * 98da603 [2013-12-14 15:12] me: first $ git checkout 00c06f3 -b repair Switched to a new branch 'repair' $ git cherry-pick 877585f..618f8e5 [repair b340e21] good 4 1 file changed, 1 insertion(+) [repair 1d2e0d0] good 5 1 file changed, 1 insertion(+) [repair 1ed1d19] good 6 1 file changed, 1 insertion(+) $ g * 1ed1d19 [2013-12-14 15:13] (HEAD, repair) me: good 6 * 1d2e0d0 [2013-12-14 15:13] me: good 5 * b340e21 [2013-12-14 15:13] me: good 4 | * 618f8e5 [2013-12-14 15:13] (master) me: good 6 | * e27d6d7 [2013-12-14 15:13] me: good 5 | * 533f6c3 [2013-12-14 15:13] me: good 4 | * 877585f [2013-12-14 15:13] me: bad |/ * 00c06f3 [2013-12-14 15:12] me: good 3 * e9f80a4 [2013-12-14 15:12] me: good 2 * 3122ba7 [2013-12-14 15:12] me: good 1 * 98da603 [2013-12-14 15:12] me: first $ git checkout master Switched to branch 'master' $ git reset --hard repair HEAD is now at 1ed1d19 good 6 $ git branch -d repair Deleted branch repair (was 1ed1d19). $ g * 1ed1d19 [2013-12-14 15:13] (HEAD, master) me: good 6 * 1d2e0d0 [2013-12-14 15:13] me: good 5 * b340e21 [2013-12-14 15:13] me: good 4 * 00c06f3 [2013-12-14 15:12] me: good 3 * e9f80a4 [2013-12-14 15:12] me: good 2 * 3122ba7 [2013-12-14 15:12] me: good 1 * 98da603 [2013-12-14 15:12] me: first $ # Done :) </code></pre> <p><code>git rebase</code> is maybe better, so at least I am showing that there are usually multiple ways in git. After all, rebase is so powerful that "all meaningful operations in git can be expressed in terms of the rebase command" (<a href="http://typicalprogrammer.com/linus-torvalds-goes-off-on-linux-and-git/" rel="nofollow">Linus Torvalds</a>).</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. 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.
    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