0
0
Gitdevops~10 mins

When to rebase vs when to merge in Git - Interactive Practice

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

Complete the command to update your feature branch with the latest changes from main using rebase.

Git
git checkout feature-branch
git [1] main
Drag options to blanks, or click blank then click option'
Apush
Bmerge
Ccommit
Drebase
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'merge' here creates a merge commit instead of rebasing.
Using 'commit' or 'push' does not update your branch with main.
2fill in blank
medium

Complete the command to combine changes from a feature branch into main using merge.

Git
git checkout main
git [1] feature-branch
Drag options to blanks, or click blank then click option'
Amerge
Bpull
Cfetch
Drebase
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'rebase' here would replay main commits onto feature-branch, not merge.
Using 'pull' or 'fetch' does not merge branches.
3fill in blank
hard

Fix the error in the command to rebase your feature branch onto main.

Git
git checkout feature-branch
git [1] origin/main
Drag options to blanks, or click blank then click option'
Acommit
Bmerge
Crebase
Dpush
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'merge' instead of 'rebase' causes a merge commit.
Using 'commit' or 'push' does not update the branch.
4fill in blank
hard

Fill both blanks to create a new branch and switch to it before rebasing.

Git
git [1] new-feature

git checkout [2]
Drag options to blanks, or click blank then click option'
Abranch
Bfeature-branch
Cnew-feature
Dcheckout
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'checkout' instead of 'branch' to create a branch.
Switching to a branch name that was not created.
5fill in blank
hard

Fill all three blanks to create a merge commit with a message after merging feature-branch into main.

Git
git checkout [1]
git merge [2] -m "[3]"
Drag options to blanks, or click blank then click option'
Amain
Bfeature-branch
CMerge feature-branch into main
Drebase
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'rebase' instead of 'merge' for combining branches.
Merging into the wrong branch.