CONFLICT (content): Merge conflict
Both versions changed the same lines in different ways, and git needs you to decide what the file should say before it finishes.
Also appears as
- CONFLICT (content): Merge conflict in src/App.tsx error: could not apply a24fbd3... Add header
- error: Pulling is not possible because you have unmerged files. hint: Fix them up in the work tree, and then use 'git add/rm <file>' hint: as appropriate to mark resolution and make a commit. fatal: Exiting because of an unresolved conflict.
- error: You have not concluded your merge (MERGE_HEAD exists).
- This branch has conflicts that must be resolved
Prompt to fix it
Git stopped with "CONFLICT (content): Merge conflict in" one or more files. List the conflicted files with git status. For each conflict, read both versions and explain what each side changed, then combine them so neither side’s intended change is lost. Remove every conflict marker, regenerate package-lock.json with npm install if it conflicted, and run the build or tests. Only then mark the files resolved and continue. Don’t resolve everything by picking one side wholesale, and don’t abort without asking me.
Paste into Layerwise or any AI coding tool.
What it means
Git combines two lines of work on its own when they touch different parts of a file. A conflict means both sides changed the same lines, and git can’t know which version is right. It pauses the merge, rebase, or pull and writes both versions into the file: <<<<<<< starts one, ======= separates it from the other, and >>>>>>> ends it. The labels after the markers say where each version came from.
Resolving means editing each marked block into what the code should actually be: one side, the other, or a mix of both. Then you mark the file as resolved with git add and finish with git commit, or with git rebase --continue during a rebase. VS Code and Cursor show buttons above each block to accept either side or both.
Leftover markers are the dangerous part. A stray <<<<<<< HEAD line is a syntax error, so the next build fails, and accepting one side wholesale can quietly drop a fix from the other. Search the project for <<<<<<< before you commit, then run the app. If you get lost, git merge --abort or git rebase --abort puts everything back.
Common causes
- An AI builder or GitHub’s web editor changed a file on GitHub while you edited the same lines locally.
- Two branches or pull requests changed the same shared file, like
App.tsx, a routes file, orpackage.json. - Both sides added dependencies, so
package.jsonandpackage-lock.jsonconflict. - A formatter or AI refactor rewrote a whole file on one branch, so every change on the other branch overlaps it.
How to fix it
- Run
git statusto list the files under “Unmerged paths.” - Open each file, find every
<<<<<<<block, and edit it into the final code. Delete all three marker lines. - For
package-lock.json, resolvepackage.jsonfirst, then runnpm install, which repairs a conflicted lockfile for you. - Run
git addon each fixed file, thengit commitfor a merge orgit rebase --continuefor a rebase. - Check for leftover markers with
git grep -n "<<<<<<<", and run the app before you push.
Example fix
git status # files under "Unmerged paths"
# Edit each file into the final code and delete the markers.
git grep -n "<<<<<<<" # should print nothing
git add src/App.tsx
git commit # or: git rebase --continueRelated errors
All errorsFailed to push some refs
GitHub has commits your copy doesn’t, so git refused to overwrite them until you bring those changes in.
Command "npm run build" exited with 1
Your build script failed on the host. This line only reports the failure; the actual error is printed earlier in the build log.
fatal: not a git repository
Git searched this folder and every folder above it and found no repository, so the command has nothing to work on.
GH013: Push cannot contain secrets
GitHub found an API key or other secret in the commits you tried to push and blocked the whole push so the secret wouldn’t land in the repository.
Build with an agent that checks its work
The Layerwise agent clicks through the live preview and reads the console, so it catches errors before you do.