← Git & GitHub learning path
Git & GitHub · Module 5 of 10

Merging and conflicts

Combine branches and resolve conflicts.

📖 Key ideas

  1. git merge feature brings changes into the current branch.
  2. Fast-forward merges just move the pointer.
  3. Conflicts happen when the same lines change differently.
  4. Conflict markers: <<<<<<<, =======, >>>>>>>.
  5. Edit, keep the right code, then git add and git commit.
💡 Real-life example: A merge conflict is two editors changing the same sentence; a human decides the final wording.
MergeCombines branch histories
Fast-forwardMerge by moving the branch pointer
ConflictCompeting changes to the same lines
Conflict markersLines showing both versions