dev@local: ~/project — git
dev@local~/project$git log
fatal: fatal bad revision head
Diagnostics Translation
Git cannot resolve 'HEAD' because the repository has no commits yet.
waiting for resolution...
LowVersion Control System
Reviewed for reference consistency: April 11, 2026
Code is Safe
SECUREGit has paused the operation to protect your code. No data has been lost or corrupted.
What To Know
This message usually means HEAD is being treated like a real commit reference even though the repository has no valid revision there yet.
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 involves the internal Git database or commit history structure.
Commands That Trigger This
$git log
Running immediately after `git init`
$git reset HEAD~1
Running before making the first commit
Technical Background
01
Many Git commands rely on traversing history backwards from HEAD. If HEAD does not point to a valid revision (commit), those commands abort.
02
Making an initial commit resolves the state, as HEAD will finally have a valid revision to anchor to.
Underlying Causes
Running log or reset commands in a freshly initialized repository
The `.git/HEAD` file was manually deleted or corrupted
Checking out an orphan branch with zero history
Frequently Asked Questions
No. It is just empty. Git has no history to show you or reset to.
Related Git States
detached-headLow
You checked out a specific commit, detaching your working directory from the branch history.
not-a-git-repositoryLow
Git could not find the hidden directory required to execute commands.
unknown-revision-or-path-not-in-working-treeLow
Git could not parse your input as a valid commit, branch, or file path.