Git your-branch-and-origin-have-diverged Status reports both the local branch and its upstream holding separate new commits.

dev@local: ~/project — git
dev@local~/project$git status
error: your branch and origin have diverged
Diagnostics Translation
Status reports both the local branch and its upstream holding separate new commits.
waiting for resolution...
LowVersion Control System

Reviewed for reference consistency: August 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 status line means the branch and its upstream have grown apart in both directions; it sizes the gap with two commit counts and leaves the reconciliation choice open.

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 status
Running after a teammate pushed while you committed locally
A long-lived feature branch receiving upstream hotfixes during development
Checking state after a force-pushed upstream rewrite made the histories asymmetric

Technical Background

01

The line belongs to Git's status family alongside 'ahead of' and 'behind' — each describes one shape of tracking difference. Divergence is the shape where neither side contains the other, so a single direction of syncing cannot repair it.

02

The two counts answer 'how big is the gap': a one-and-one split often resolves to a quick rebase, while large asymmetric counts deserve a look at the remote commits before integrating. Status never picks a strategy; it only sizes the difference.

Underlying Causes

Local commits were made without pushing while others pushed their own
The upstream branch was rewritten by a force-push
A pull was skipped or failed earlier, leaving both sides free to advance
The branch was rebased locally but never pushed with the matching update

Frequently Asked Questions

The output suggests `git pull` to integrate the remote branch; with no reconciliation configured, modern Git asks how divergent histories should be handled before it proceeds.

Yes. The counts cover all commits reachable from one side and not the other, merge commits included.

Related Git States