Common causes
- You created a new local branch but never pushed it to the remote
- The upstream tracking was removed or never set
- You renamed the branch locally but the remote branch still has the old name
- You're pushing for the first time on this branch
How to fix it
- Push and set the upstream at the same time: git push -u origin <branch-name>
- Set the upstream without pushing: git branch --set-upstream-to=origin/<branch-name>
- Check current tracking info: git branch -vv
- After setting upstream, plain git push and git pull will work normally
Example
fatal: The current branch feature/auth has no upstream branch.
To push the current branch and set the remote as upstream, use:
git push --set-upstream origin feature/authRunning git push on a newly created local branch for the first time
Have a different error?
Paste any error message into the Error Translator to get an instant explanation.
