no upstream branch 🌿 Git

fatal: The current branch x has no upstream branch.

The local branch isn’t linked to a remote branch yet, so a bare git push doesn’t know where to go.

Seen on: Git

Meaning

New branches need an upstream set on the first push.

Common causes

  • First push of a new branch
  • Branch created from a local commit rather than from a remote branch

⚡ Quick fix

  1. git push -u origin <branch>
  2. Or enable auto setup: git config --global push.autoSetupRemote true

Detailed fix by platform

Git

  1. git config --global push.autoSetupRemote true

How to diagnose

  1. Tracking — git branch -vv
  2. Recent change — Did it start after a deploy, upgrade, or configuration change? Compare with the last working version.

🧠 Still stuck? Analyze your error

Paste the full message, response headers or stack trace — we'll detect the platform and point to the most likely cause.