AlgoMaster Logo

Merging - Quiz

Last Updated: January 3, 2026

Merging Exercises

29 quizzes

1
Code Completion

Start combining changes from the branch 'feature-login' into the currently checked-out branch

shell
1
git feature-login

Click an option to fill the blank:

2
Code Completion

Prevent Git from creating a merge commit when merging 'feature-api' into the current branch, only allowing a fast-forward

shell
1
git merge feature-api

Click an option to fill the blank:

3
Code Completion

Begin a squash merge of branch 'feature-payment' into the current branch without creating the commit automatically

shell
1
git merge feature-payment

Click an option to fill the blank:

4
Code Completion

Abort an in-progress merge and return the working tree to the state before the merge started

shell
1
git merge

Click an option to fill the blank:

5
Code Completion

Use a specific merge strategy to combine 'feature-a' and 'feature-b' into the current branch in a single operation

shell
1
git merge feature-a feature-b

Click an option to fill the blank:

6
Multiple Choice

In a fast-forward merge, what happens to the target branch?

7
Multiple Choice

Which situation guarantees that Git will perform a three-way merge instead of a fast-forward?

8
Multiple Choice

During a merge conflict, what do the lines between ======= and >>>>>>> typically represent?

9
Multiple Choice

What is a key advantage of using a squash merge when integrating a feature branch?

10
Multiple Choice

Which merge strategy is Git's default when merging two branches?

11
Sequencing

Order the steps to perform a standard three-way merge of a feature branch into main when both branches have new commits.

Drag and drop to reorder, or use the arrows.

12
Sequencing

Order the steps to perform a squash merge of 'feature-report' into 'main'.

Drag and drop to reorder, or use the arrows.

13
Sequencing

Order the steps to safely abort a problematic merge and start a fresh merge into the correct target branch.

Drag and drop to reorder, or use the arrows.

14
Sequencing

Order the steps to resolve a simple merge conflict using a text editor.

Drag and drop to reorder, or use the arrows.

15
Output Prediction

You are currently on branch 'feature-xyz'. What single line of output will this command show?

1git branch --show-current
16
Output Prediction

You run a merge that results in conflicts. What will this command print as a single line?

1git status --short --branch | head -n 1
17
Output Prediction

Immediately after starting a merge of 'feature-api' into 'main' with no conflicts yet resolved, what branch relationship will Git show?

1git for-each-ref --format='%(refname:short)' --points-at=HEAD
18
Bug Spotting

Identify the incorrect command in this attempt to resolve a merge conflict and complete the merge.

Click on the line(s) that contain the bug.

shell
1
git status
2
git add conflicted-file.js
3
git merge main -m "Resolve conflicts"
4
git status
19
Bug Spotting

Find the incorrect command in this workflow intended to perform a fast-forward merge of 'feature-analytics' into 'main'.

Click on the line(s) that contain the bug.

shell
1
git checkout main
2
git pull origin main
3
git merge --no-ff --ff-only feature-analytics
4
git push origin main
20
Bug Spotting

Identify the problematic command in this attempt to abort a merge and discard local merge changes.

Click on the line(s) that contain the bug.

shell
1
git status
2
git reset --hard --abort
3
git status
4
git merge feature-cleanup
21
Matching

Match each merge-related command with its primary purpose.

Click an item on the left, then click its match on the right. Click a matched item to unmatch.

22
Matching

Match each merge strategy with the scenario it best fits.

Click an item on the left, then click its match on the right. Click a matched item to unmatch.

23
Matching

Match each conflict-related command with what it accepts or selects during a merge.

Click an item on the left, then click its match on the right. Click a matched item to unmatch.

24
Fill in the Blanks

Complete the commands to resolve conflicts using a mergetool, then finish the merge.

shell
1
git status
2
git ___
3
git add app.js
4
git commit ___

Click an option to fill blank 1:

25
Fill in the Blanks

Complete the commands to perform a fast-forward-only merge of 'feature-docs' into 'main'.

shell
1
git checkout main
2
git pull origin main
3
git merge ___ feature-docs

Click an option to fill blank 1:

26
Fill in the Blanks

Complete the commands to start and then abort a merge from 'feature-refactor'.

shell
1
git merge ___
2
git merge ___

Click an option to fill blank 1:

27
Hotspot Selection

Select the line that indicates a merge conflict is currently in progress.

Click on the line to select.

shell
1
On branch main
2
You have unmerged paths.
3
  (fix conflicts and run "git commit")
4
  (use "git merge --abort" to abort the merge)
5
 
6
Unmerged paths:
7
  (use "git add <file>..." to mark resolution)
8
	both modified:   src/index.js
28
Hotspot Selection

Click the line that shows which file is currently in conflict.

Click on the line to select.

shell
1
On branch main
2
You have unmerged paths.
3
  (fix conflicts and run "git commit")
4
 
5
Unmerged paths:
6
  (use "git add <file>..." to mark resolution)
7
	both modified:   README.md
29
Hotspot Selection

Select the line that shows the automatic merge commit message template after a successful three-way merge (before you edit it).

Click on the line to select.

shell
1
Merge branch 'feature-xyz' into main
2
 
3
# Please enter a commit message to explain why this merge is necessary,
4
# especially if it merges an updated upstream into a topic branch.
5
# Lines starting with '#' will be ignored, and an empty message aborts the commit.