git branch --set-upstream-to=<remote>/<branch> main code example Example: github set branch upstream git push --set-upstream origin <remote-branch>