The error bellow happens everytime that I need to push a brand new brach to a remote git server using the command git push -u.
fatal: The current branch <branchname> has no upstream branch.
To push the current branch and set the remote as upstream, use
git push --set-upstream origin <branchname>
Git needs to configure the push strategy to auto create a remote mirror of your new branch automatically. The command to do that is:
git config --global push.default current
That's it!
For more details, you can check the docs here
Top comments (0)