0
0
Gitdevops~10 mins

Why rebasing creates linear history in Git - Test Your Understanding

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the command to start rebasing the current branch onto main.

Git
git rebase [1]
Drag options to blanks, or click blank then click option'
Adevelop
Bmain
Cfeature
Dorigin
Attempts:
3 left
💡 Hint
Common Mistakes
Using the wrong branch name like 'feature' or 'origin' instead of 'main'.
Confusing rebase with merge commands.
2fill in blank
medium

Complete the command to abort a rebase in progress.

Git
git rebase --[1]
Drag options to blanks, or click blank then click option'
Acontinue
Bskip
Cabort
Dedit
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'continue' which tries to proceed with the rebase.
Using 'skip' which skips the current patch.
3fill in blank
hard

Fix the error in the command to rebase interactively.

Git
git rebase -[1] main
Drag options to blanks, or click blank then click option'
Ai
Ba
Cm
Dr
Attempts:
3 left
💡 Hint
Common Mistakes
Using flags like '-a' or '-m' which are not valid for rebase.
Forgetting the dash before the flag.
4fill in blank
hard

Fill both blanks to create a linear history by rebasing and then pushing with force.

Git
git rebase [1] && git push origin [2] --force
Drag options to blanks, or click blank then click option'
Amain
Bfeature-branch
Cmaster
Ddevelop
Attempts:
3 left
💡 Hint
Common Mistakes
Mixing up the branch names for rebase and push.
Forgetting to use --force when pushing after rebasing.
5fill in blank
hard

Fill all three blanks to create a linear history dictionary comprehension filtering commits by author.

Git
commits = { [1]: [2] for [3] in commit_list if [3].author == 'Alice' }
Drag options to blanks, or click blank then click option'
Acommit.hash
Bcommit.message
Ccommit
Dcommit.id
Attempts:
3 left
💡 Hint
Common Mistakes
Using commit.id which may not exist.
Using the wrong variable name in the loop.