Practice - 5 Tasks
Answer the questions below
1fill in blank
easyComplete the command to perform a fast-forward merge of branch 'feature' into 'main'.
Git
git checkout main && git merge [1] Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'commit' or 'reset' instead of the branch name.
Trying to merge without checking out the main branch first.
✗ Incorrect
To fast-forward merge, you merge the feature branch into main using 'git merge feature'.
2fill in blank
mediumComplete the command to update the local branch with a fast-forward merge from the remote 'origin/main'.
Git
git fetch origin && git merge [1] Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Merging a local branch instead of the remote branch after fetch.
Using the wrong remote branch name.
✗ Incorrect
After fetching, merging 'origin/main' updates your local branch with the remote changes using fast-forward if possible.
3fill in blank
hardComplete the command to perform a fast-forward ONLY merge of branch 'feature' into 'main'.
Git
git checkout main && git merge [1] feature Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using '--no-ff' which disables fast-forward merges.
Omitting the option (defaults to fast-forward if possible, but not enforced).
✗ Incorrect
'--ff-only' ensures the merge is fast-forward or fails if not possible. '--no-ff' forces a merge commit even if fast-forward is possible.
4fill in blank
hardFill both blanks to create a fast-forward merge command that updates 'main' with 'feature' branch changes.
Git
git checkout [1] && git merge [2]
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Switching the order of branches.
Using 'develop' or 'master' instead of 'main' or 'feature'.
✗ Incorrect
You first checkout 'main' branch, then merge the 'feature' branch to fast-forward update.
5fill in blank
hardFill all three blanks to perform a safe fast-forward update of 'main' from the remote 'origin'.
Git
git checkout [1] && git fetch [2] && git merge --ff-only [3]
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Merging local 'main' instead of 'origin/main'.
Wrong remote name or forgetting fetch.
Using 'feature' instead of 'main' remote.
✗ Incorrect
Checkout 'main', fetch from 'origin', merge 'origin/main' with --ff-only to ensure it's a fast-forward merge or fail.