Victoria Drake @victoria.dev

September 13, 2020

Setting up a new remote branch? Use git push -u origin HEAD to automatically push the current branch to a new remote branch with the same name.

Annoyingly, git push doesn’t automatically set the upstream branch.

https://git-scm.com/docs/git-push#Documentation/git-push.txt–u

fatal: The current branch <branch name> has no upstream branch.
To push the current branch and set the remote as upstream, use

    git push --set-upstream origin <branch name>