changes overwritten Git Origin: Build & delivery Last updated 12 Oct 2026

error: Your local changes to the following files would be overwritten by merge

git pull/merge would modify files you’ve changed but not committed.

Exact message you may see would be overwritten by mergePlease commit your changes or stash them before you merge
Seen on: Git

Meaning

Git refuses to clobber uncommitted work. Commit, stash or discard the changes first.

Common causes

  • Uncommitted edits to files changed upstream
  • Generated files tracked in git (build output, lockfiles)
  • Line-ending normalisation changes

⚡ Quick fix

  1. Commit your changes, then pull
  2. Or stash: git stash && git pull && git stash pop
  3. Discard if not needed: git restore <file>

Detailed fix by platform

Git

  1. git stash push -m "wip" && git pull --rebase && git stash pop

How to diagnose

  1. Files — Which files are listed?
  2. Intent — Keep or discard the changes?

🔧 Still not fixed?

Many errors look alike. If the steps above didn’t solve it, one of these is probably what you’re facing:

Where this error sits

Origin: Build & delivery. Errors that are often confused with or caused by this one (click to open):

cannot rebase — error: cannot pull with rebase: You have unstaged changes. Please commit or stash them. (Git)cannot rebaseCONFLICT — Git: CONFLICT (content): Merge conflict in file — Automatic merge failed (Git)CONFLICTnot possible to fast-forward — fatal: Not possible to fast-forward, aborting. (Git)not possible to fast-…overwritten by checkout — error: Your local changes to the following files would be overwritten by checkout (Git)overwritten by checko…unfinished merge — fatal: You have not concluded your merge (MERGE_HEAD exists). Please, commit your changes before you merge. (Git)unfinished mergeuntracked files overwritten — error: The following untracked working tree files would be overwritten by checkout/merge (Git)untracked files overw…changes o…

Explore the map of this error Full error map →

🧠 Still stuck? Analyze your error

Paste the full message, response headers or stack trace — we'll detect the platform and point to the most likely cause.

💬 What worked for others

No tips yet — did something else fix this for you?

Share what worked for you

Tips are checked by an editor before they appear. Links are removed.