Skip to content
Latchkey

Chromatic "git history not found" / shallow clone in CI

Chromatic walks git history to find the ancestor commit that produced the baseline snapshots. A shallow clone (the default fetch-depth: 1) hides ancestors, so Chromatic cannot establish a baseline and warns or fails.

What this error means

The chromatic step reports it could not find the baseline commit or that the git history is incomplete, often advising a full clone with fetch-depth 0.

chromatic
Chromatic only has access to the current commit and cannot find baseline builds.
This usually happens when the repository is checked out with a shallow clone.
Set fetch-depth: 0 on actions/checkout.

Common causes

actions/checkout uses a shallow clone by default

The default fetch-depth: 1 fetches only the latest commit, so Chromatic cannot walk back to the baseline commit.

A squashed or rebased branch lost the baseline ancestor

History rewrites can detach the branch from the commit Chromatic recorded the baseline against, leaving no common ancestor in a shallow clone.

How to fix it

Fetch full history in checkout

  1. Set fetch-depth: 0 on the checkout step.
  2. Run the chromatic step after the full-history checkout.
  3. Re-run so Chromatic can resolve the baseline.
.github/workflows/ci.yml
- uses: actions/checkout@v4
  with:
    fetch-depth: 0
- uses: chromaui/action@latest
  with:
    projectToken: ${{ secrets.CHROMATIC_PROJECT_TOKEN }}

Unshallow before Chromatic if needed

If you cannot change checkout, deepen the existing clone before running Chromatic.

Terminal
git fetch --unshallow || true

How to prevent it

  • Use fetch-depth: 0 for any tool that reads git history, including Chromatic.
  • Keep the Chromatic job on the same checkout that has full history.
  • Avoid rewriting history on branches that carry Chromatic baselines.

Frequently asked questions

What causes ""git history" not found (shallow clone)"?
The default fetch-depth: 1 fetches only the latest commit, so Chromatic cannot walk back to the baseline commit.
How do I fix "git history" not found (shallow clone)?
Fetch full history in checkout

Related guides

References

Latchkey auto-heals failures like this one - detected, fixed, and retried without you. Start free → 30-day trial · No credit card