All fixes

Help, I can't push: “has no upstream branch”

Your new branch does not exist on the remote yet. One push with -u creates it and links the two.

What Git says~/my-app
git push
fatal: The current branch feature/login has no upstream branch.
To push the current branch and set the remote as upstream, use

    git push --set-upstream origin feature/login

To have this happen automatically for branches without a tracking
upstream, see 'push.autoSetupRemote' in 'git help config'.

The fix

  1. git push -u origin feature/login

    Pushes the branch and makes origin/feature/login its upstream. From now on plain git push and git pull just work.

feature/login is an example. Replace it with your own.

Why this works

A new local branch has no partner on the remote, so plain git push does not know where to go. -u (short for --set-upstream) pushes the branch and remembers the pairing, after which push and pull work without arguments. Since Git 2.37 you can make this automatic: git config --global push.autoSetupRemote true.