Here's what I want:
git checkout -b mybranch
<make changes>
git commit -m'changes'
git push
The branch I just created with the changes I made to exist on the remote origin. Furthermore, when I later pull, it should pull the same branch.
My current settings:
[push]
default = current
[branch]
autoSetupMerge = always
What do I need to do to force git to behave the way I want it to? It used to work with my current settings, now it just says "everything up to date", which clearly it is not because this branch does not exist on the remote.
Edit: Apparently pull.default
isn't a valid setting, fine. So I removed it, but that's not causing the incorrect behavior anyway.
Setting push.default=upstream
is DANGEROUS since now git checkout -b <newbranch>
for some reason sets up where you branched from as the tracking branch. So if you're on main
and create a new branch, main
is the tracking branch. And push.default=upstream
will merge changes to main
. This is terrible behavior and bewilderingly more wrong than push.default=current
.