0
0
Gitdevops~10 mins

Three-way merge in Git - Interactive Code Practice

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

Complete the command to start a three-way merge in Git.

Git
git merge [1]
Drag options to blanks, or click blank then click option'
Abranch
Bcommit
Crebase
Dcheckout
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'commit' instead of 'branch' causes an error.
Using 'rebase' changes history instead of merging.
2fill in blank
medium

Complete the command to abort a conflicted merge.

Git
git merge --[1]
Drag options to blanks, or click blank then click option'
Askip
Babort
Ccontinue
Dreset
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'continue' tries to finish the merge instead of aborting.
Using 'reset' is a different command and does not abort merge.
3fill in blank
hard

Fix the error in the command to view the merge base commit.

Git
git merge-base [1] feature
Drag options to blanks, or click blank then click option'
Acommit
Bbranch
CHEAD
Dorigin
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'branch' or 'commit' causes errors because they are not valid references here.
Using 'origin' refers to a remote, not a commit or branch.
4fill in blank
hard

Fill both blanks to create a dictionary of files changed and their status after a merge.

Git
git diff --name-status [1] [2]
Drag options to blanks, or click blank then click option'
AHEAD
BMERGE_HEAD
Corigin/main
Dfeature
Attempts:
3 left
💡 Hint
Common Mistakes
Using HEAD instead of MERGE_HEAD shows differences with current branch, not merge target.
Using origin/main mixes remote with local merge references.
5fill in blank
hard

Fill all three blanks to create a dictionary comprehension that filters files changed in a merge with status 'M' (modified).

Git
changed_files = { [1]: [2] for [3] in files if status == 'M' }
Drag options to blanks, or click blank then click option'
Afilename
Bstatus
Dfile
Attempts:
3 left
💡 Hint
Common Mistakes
Using the same variable name for key and loop variable causes confusion.
Not filtering by status 'M' includes unwanted files.