Git basics

Copy one commit to another branch (cherry-pick)

Bring a single commit over from another branch, without merging the whole branch.

Fill these in once
  1. Find the commit's ID on the other branch
    Terminal
    git log --oneline fix-login-button
  2. Copy it onto the branch you're on
    Terminal
    git cherry-pick a1b2c3d

Check it worked

  1. See it at the top of your branch
    Terminal
    git log --oneline -5
Undo it
  1. Stop if it hits a conflict
    Terminal
    git cherry-pick --abort
  1. Find the commit's ID on the other branch
    Terminal · Ubuntu / Debian
    git log --oneline fix-login-button
  2. Copy it onto the branch you're on
    Terminal · Ubuntu / Debian
    git cherry-pick a1b2c3d

Check it worked

  1. See it at the top of your branch
    Terminal · Ubuntu / Debian
    git log --oneline -5
Undo it
  1. Stop if it hits a conflict
    Terminal · Ubuntu / Debian
    git cherry-pick --abort
  1. Find the commit's ID on the other branch
    PowerShell
    git log --oneline fix-login-button
  2. Copy it onto the branch you're on
    PowerShell
    git cherry-pick a1b2c3d

Check it worked

  1. See it at the top of your branch
    PowerShell
    git log --oneline -5
Undo it
  1. Stop if it hits a conflict
    PowerShell
    git cherry-pick --abort