Skip to main content
Middle

Juggling Commits #2

Middle

Task

Copy the commit C2 located at the tip of newImage into two branches: main and caption.

Steps

  1. Switch to main and bring C2 over there.
  2. Switch to caption and bring the same original commit C2 over there.

Expected result

Independent copies of the change from C2 must appear in main and caption. The original newImage branch must stay in place.

What you will learn

After completing the task, you will be able to:

  • apply one commit to several branches;
  • switch the target branch before cherry-pick;
  • tell the original commit apart from its independent copies.
Goal
localC0C1C2newImageC2'mainC3C2''HEAD caption
Git trainer0 commands
terminal
localC0C1mainC2newImageC3HEAD caption