dev@local: ~/project — git
dev@local~/project$git clone
fatal: remote head nonexistent ref
Diagnostics Translation
The remote repository's default branch points to a branch that does not exist.
waiting for resolution...
LowVersion 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 points to a broken default-branch pointer on the remote side: the repository data exists, but the server is advertising a branch that is not there.

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
The error occurred during a network exchange. Your local files are untouched, but Git cannot reach the remote server.

Commands That Trigger This

$git clone
Running on a newly created GitHub repository that has zero commits
$Cloning a repository immediately after an admin deleted the default branch
Cloning a repository immediately after an admin deleted the default branch

Technical Background

01

This is typically a warning rather than a hard failure. Git has downloaded the `.git` directory, but cannot populate the visible files.

02

The clone usually contains repository data already; the missing piece is a valid default branch target for the first working-tree checkout.

Underlying Causes

Cloning an entirely empty repository that has no commits yet
The repository's default branch was recently deleted on the server
A server misconfiguration points HEAD to an invalid reference

Frequently Asked Questions

Usually not. This state normally means the repository data arrived, but the remote default-branch pointer did not lead to a real branch for the first checkout.

Related Git States