dev@local: ~/project — git
dev@local~/project$git pull origin main
fatal: unrelated histories
Diagnostics Translation
Git refused to merge two projects because they do not share a common ancestor commit.
waiting for resolution...
MediumVersion Control System

Reviewed for reference consistency: April 11, 2026

Code is Safe

SECURE

Git has paused the operation to protect your code. No data has been lost or corrupted.

What To Know

This message means Git sees two independent commit timelines with no shared ancestor, so it treats the merge as a potentially accidental project crossover.

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 origin main
Running right after connecting a new local project to a new GitHub repository
$Merging a fork back into a project after the fork's root history was completely rewritten
Merging a fork back into a project after the fork's root history was completely rewritten

Technical Background

01

This is a safety feature introduced in Git 2.9. It stops developers from accidentally merging the wrong project URL.

02

If the merge is truly intentional, Git requires an explicit override because this state looks very similar to pointing at the wrong repository by accident.

Underlying Causes

Creating a remote repository with a README/LICENSE and a local repository independently, then trying to sync them
Attempting to pull a completely different project into your current repository
Merging two repositories that were initialized separately

Frequently Asked Questions

Because unrelated histories look very similar to selecting the wrong repository or connecting two projects that were never meant to share a timeline.

Related Git States