ProjectStack
git

fatal: Not a valid object name

Git can't find a commit, branch, or tag matching the name you provided. The reference doesn't exist in this repository's history.

Common causes

  • Typo in a branch name, tag, or commit hash
  • Referencing a branch from another repo that hasn't been fetched
  • The branch or tag was deleted after you copied its name
  • Using a short commit hash that's ambiguous or doesn't exist locally

How to fix it

  1. Fetch all refs from remote: git fetch --all
  2. List local branches: git branch -a
  3. List all tags: git tag
  4. If using a commit hash, double-check it with git log --oneline

Example

fatal: Not a valid object name: 'feature/missing-branch'

Running git show or git checkout with a branch name that was deleted or never fetched

Have a different error?

Paste any error message into the Error Translator to get an instant explanation.