Imagine two friends editing the same paragraph in a shared document at the same time. What causes Git to show a merge conflict when combining changes?
Think about what happens when two people edit the same exact sentence differently.
Merge conflicts happen when Git tries to combine changes but finds that the same lines were changed in different ways in two branches. It cannot automatically decide which change to keep, so it asks the user to resolve the conflict.
You run git merge feature but the branches have conflicting changes. What message does Git show?
git merge featureLook for keywords like 'CONFLICT' and 'Automatic merge failed'.
When Git cannot merge automatically due to conflicting changes, it shows a message indicating which files have conflicts and that the user must fix them before committing.
After a merge conflict, which Git command lists the files that have conflicts needing resolution?
Think about which command shows the current state of your working directory and staged files.
git status shows files with conflicts marked as 'both modified', helping you identify which files need fixing.
After a merge conflict, what is the correct sequence of steps to fix and complete the merge?
Remember you must start the merge, then fix conflicts, stage changes, and finally commit.
The correct workflow is to run git merge first, then fix conflicts in files, stage the fixed files, and commit the merge.
Which reason best explains why regularly pulling changes from the main branch helps reduce merge conflicts?
Think about how staying updated helps avoid surprises when merging.
Pulling often keeps your branch close to the main branch's state, so you resolve small conflicts early and avoid big conflicts later.