I'd like to set the default upstream branch of any branch I create locally to be origin/main
.
This is mainly for pull --rebase
, since we never push to remote (only through a code review process).
Right now I achieve this by:
$ git checkout -b some-new-branch-name
$ git branch --set-upstream-to=origin/main
It's OK (I have a Bash alias to do that for me), but I was wondering whether I can set git's config to do that automatically.
So far I looked through the git-config
documentation and StackOverflow questions but haven't found a solution.
Is this possible?