Create remote branches automatically

Have you ever created a branch on your computer and pushed it? Then you have probably been annoyed at the message:
fatal: The current branch test-branch has no upstream branch.
To push the current branch and set the remote as upstream, use

    git push --set-upstream origin test-branch
But fear not! Help is near! Just add the following configuration option for git (the –global flag will put the option in your global git config, if you don’t want that, just remove the flag):
git config --global push.autoSetupRemote true