Conflicts for Git and GitHubs
A merge conflict occurs when Git cannot combine changes automatically because two branches edited the same lines or one deleted what the other changed. Git marks the file with conflict markers, and you edit them to the intended result. Branching strategies reduce how often conflicts arise.
Stage: Branching · Part of the Git and GitHub roadmap · Last reviewed 19 November 2026
What to learn in Conflicts
- Read conflict markers and decide which lines to keep
- Resolve a conflict, stage the file and finish the merge
- Abort a merge or rebase safely when it goes wrong
- Use a merge tool to compare both sides and the base
- Compare trunk-based development with Gitflow
Conflicts interview questions
How do you resolve a merge conflict?
Open the conflicted file, find the markers with the two versions, edit to the correct combined content and remove the markers. Then git add the file, and run git commit or git rebase --continue to complete the operation.
What is trunk-based development?
In trunk-based development developers merge small, frequent changes into one main branch, often behind feature flags, instead of keeping long-lived branches. It reduces large conflicts and supports continuous integration, but needs good tests.
Where Conflicts fits in the Git and GitHub roadmap
Conflicts belongs to the Branching stage (beginner level), which takes about 9 hours. Work in parallel.
Other units in this stage
Back to the full Git and GitHub roadmap