Skip to content
Foxipa
Code Completion 4 Challenges

Complete the Git commands: Git Rebase Model: Transplanting Commits onto a New Base

Create a disposable repository with a base commit. Create a topic branch and commit topic work. Advance main with a separate commit. Return to topic and run `git rebase main`. Record the topic tip before and after, prove the IDs differ, prove the new topic tip descends from main, and verify that main itself did not move. Do not use interactive rebase or resolve a conflict here; those are later ownership boundaries.

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  origin/main

Press Ctrl⌘Enter to check your answer

Challenge 3

Complete the Git command to change the checked-out branch.

bash Your answer
git  -c topic

Press Ctrl⌘Enter to check your answer

Challenge 4

Complete the Git command to change the checked-out branch.

bash Your answer
git  main

Press Ctrl⌘Enter to check your answer