autosetuprebase vs autosetupmerge

What is counterintuitive here is the naming of these preferences. They do look like they refer to the same functionality, but in fact they don't:

  • autosetupmerge controls whether git branch and git checkout -b imply the --track option, i.e. with your setting of always,
    • git checkout branchname, if branchname exists on a remote but not locally, will create branchname tracking its remote counterpart
    • git checkout -b newbranch will create a new branch newbranch tracking whichever branch you had checked out before issuing this command
  • autosetuprebase controls whether new branches should be set up to be rebased upon git pull, i.e. your setting of always will result in branches being set up such that git pull always performs a rebase, not a merge. (Be aware that existing branches retain their configuration when you change this option.)

So it makes perfect sense to have both autosetupmerge = always and autosetuprebase = always; in fact, that's also what I have.


since this is the first hit, if you search for "autosetuprebase" with google, here an advice:

git config --global branch.autosetuprebase always

Source https://mislav.net/2010/07/git-tips/


It's probably worth mentioning that there is a difference between autosetupmerge=always (in your config) and autosetupmerge=true (the default).

true will only setup merging for remote branches. always will include local branches as well.

You probably want true.

Tags:

Git