Git & GitHub Mastery: Workflows & CI/CD
Back to Real-World Git Workflows

Resolving Merge Conflicts

The conflict markers, the strategies, and the tools that make resolution easier (mergetool, IDE integrations). FIND_VIDEO: search 'git merge conflict resolution tutorial' — recommended channel: Fireship / Atlassian. Aim for 10 min or under.

8 minutesVideo LessonPDF notes
🎯 Free Guest Mode: You are learning for free. Sign in to save your completion progress and quiz answers.
Loading progress...

Key moments

  1. Git Merge Mechanism — Explains the three-way merge concept and why conflicts occur when the auto-merge algorithm fails.
  2. Handling Dirty Directory — Demonstrates using `git stash` to temporarily save uncommitted local changes before attempting a merge.
  3. Diagnosing Conflicts — Shows how to use `git status` to identify unmerged paths and `git merge --abort` to exit the conflicted state.
  4. Manual Resolution — Details the process of interpreting and manually editing files containing the Git conflict markers.
  5. IDE Tool Resolution — Illustrates using visual tools in VS Code to accept or reject changes instead of manual marker deletion.
  6. Finalizing the Merge — Covers staging the resolved file using `git add` and completing the process with a final merge commit.
PDF notes

Frequently asked questions

What does Git compare during a merge?

Git compares the tips of both branches against their common ancestor commit (the three-way merge).

What is the difference between a dirty working directory error and a structural conflict?

A dirty working directory error prevents the merge from starting; a structural conflict occurs when the merge fails mid-process due to overlapping changes.

If I resolve a conflict, do I need a special command to finish?

No, after resolving the file and running `git add`, a standard `git commit` completes the merge process.

Can I use VS Code to resolve conflicts even if I started the merge in the CLI?

Yes, IDE tools simply edit the file content; you return to the CLI for staging and committing the result.

How was this lesson?

Your feedback helps us refine explanations and catch bugs.