dev@local: ~/project — git
dev@local~/project$git pull
Updating a1b2c3d..d4e5f6g
error: local changes overwritten by merge
Please commit your changes or stash them before you switch branches.
Aborting
Diagnostics Translation
Git aborted the merge to protect uncommitted changes in your working directory.
waiting for resolution...
MediumVersion Control System

Reviewed for reference consistency: April 11, 2026

Data Loss Risk

HIGH RISK

Git stopped to prevent overriding unsaved work. Do not force commands without stashing or committing first.

What To Know

This message points to a collision between incoming tracked content and uncommitted local edits, with Git stopping before your working copy is overwritten.

Where Did It Fail?

Working Tree
Your local files
add
Staging Index
Prepared changes
commit
Local Repo
Commit history
push/fetch
Remote Server
GitHub/GitLab
Git halted to protect the uncommitted files in your active working directory.

Commands That Trigger This

$git pull
Running while actively editing a file that your coworker also edited and pushed
$git merge
Attempting when `git status` shows modified, uncommitted files

Technical Background

01

Git is strictly designed to never destroy uncommitted work without explicit force flags.

02

When Git detects that an incoming merge touches the exact same file you are currently editing, it halts entirely before altering your local disk.

03

The key point is that Git wants those local edits preserved in a safer state before it attempts to overlay incoming tracked content.

Underlying Causes

Pending local modifications to tracked files
Uncommitted edits that conflict with incoming changes from a pull or merge
Untracked files that share a name with an incoming file

Frequently Asked Questions

Merge conflicts require both sets of changes to be committed to the repository. Uncommitted working directory changes are not safely stored yet, so Git aborts to protect them.

Related Git States