Loading...
Loading...
CONFLICT (content): Merge conflict in src/index.jsA merge conflict occurs when Git cannot automatically merge two branches because both branches modified the same lines of the same file. Git marks the conflicting sections and requires you to manually choose which version to keep.
Use git status to list all files with conflicts.
git status
# Look for lines starting with "both modified:"Open each conflicting file and resolve the markers manually.
<<<<<<< HEAD
// Your current branch's version
const value = 'from-main';
=======
// The incoming branch's version
const value = 'from-feature';
>>>>>>> feature-branch
// Delete the markers and keep the version you want:
const value = 'from-feature'; // ✅ resolvedAfter resolving all conflicts, stage the files and complete the merge.
git add src/index.js
git commit -m "Merge feature-branch into main"