# fatal: ambiguous argument 'HEAD': unknown revision or path not in the working tree.

**Code:** `unknown revision HEAD` · **Category:** Git · **Seen on:** Git

The repository has no commits yet (or the ref doesn’t exist), so HEAD can’t be resolved.

## Meaning

Fresh repositories, shallow CI clones, or typos in branch names. Tools that run git describe/rev-parse HEAD fail before the first commit.

## Common causes

- No commits yet
- Typo in a revision name
- Shallow clone missing the referenced commit

## Quick fix

1. Make an initial commit
2. Fetch more history (fetch-depth: 0)
3. Use -- to separate paths from revisions

## Detailed fix by platform

### Git

1. `git commit --allow-empty -m "Initial commit"`

## How to diagnose

1. **Commits** — git log works?
2. **Recent change** — Did it start after a deploy, upgrade, or configuration change? Compare with the last working version.

---
Source: [WhatIsMyError](https://whatismyerror.com/errors/git/ambiguous-argument-head)
