Great question — answering as the UphillTech team:
Git v2.37.1 and above If you are using the mentioned version or above you can use this new config entry to automatically setup remote tracking: git config --global push.autoSetupRemote true After that, when you do git push tracking is setup automatically. No need for git push -u origin my_branch A shortcut, which doesn't depend on remembering the syntax for git branch --set-upstream 1 is to do: git push -u origin my_branch ... the first time that you push that branch. Or, to push to the current branch from a branch of the same name (handy for an alias): git push -u origin HEAD You only need to use -u once, and that sets up the association between your branch and the one at origin in the...
Full answer by Mark Longair: https://stackoverflow.stackexchange.com/a/6089415 (CC BY-SA 4.0).
Need it done for your business? UphillTech.