Skip to content
Foxipa
Code Completion 4 Challenges

Complete the Git commands: Git Rebase: Running, Controlling, and Verifying History Rewrites

In a disposable repository, create a base commit, branch to `topic`, make a topic commit, advance `main` independently, then rebase `topic` onto `main`. Record the topic tip before and after. Prove the IDs differ, prove the new topic tip descends from main, and verify that main did not move. Then repeat the experiment with `--onto` using a three-branch topology. Do not use interactive rebase; do not publish the rewritten branch.

Advanced ~6 min read

Challenge 1

Complete the Git command to replay commits onto a new base.

bash Your answer
git  main

Press Ctrl⌘Enter to check your answer

Challenge 2

Complete the Git command to replay commits onto a new base.

bash Your answer
git  --onto main server client

Press Ctrl⌘Enter to check your answer

Challenge 3

Complete the Git command to replay commits onto a new base.

bash Your answer
git  <upstream> <branch>

Press Ctrl⌘Enter to check your answer

Challenge 4

Complete the Git command to replay commits onto a new base.

bash Your answer
git  main topic

Press Ctrl⌘Enter to check your answer