These variables can be set from the transient prefix command
magit-branch-configure. By default they can also be set from
magit-branch. See Branch Commands.
branch.NAME.remote this variable defines the upstream branch of the local branch named NAME. The value of this variable is the full reference of the upstream branch.
branch.NAME.merge this variable defines the upstream branch of the local branch named NAME. The value of this variable is the name of the upstream remote.
This variable controls whether pulling into the branch named NAME is done by rebasing or by merging the fetched branch.
truethen pulling is done by rebasing.
falsethen pulling is done by merging.
- When undefined then the value of
pull.rebaseis used. The default of that variable is
This variable specifies the remote that the branch named NAME is usually pushed to. The value has to be the name of an existing remote.
It is not possible to specify the name of branch to push the local branch to. The name of the remote branch is always the same as the name of the local branch.
If this variable is undefined but
remote.pushDefault is defined, then the value of the latter is used. By default
remote.pushDefault is undefined.
This variable can be used to describe the branch named NAME. That description is used e.g. when turning the branch into a series of patches.
The following variables specify defaults which are used if the above branch-specific variables are not set.
This variable specifies whether pulling is done by rebasing or by merging. It can be overwritten using
truethen pulling is done by rebasing.
false(the default) then pulling is done by merging.
Since it is never a good idea to merge the upstream branch into a feature or hotfix branch and most branches are such branches, you should consider setting this to
This variable specifies what remote the local branches are usually pushed to. This can be overwritten per branch using
The following variables are used during the creation of a branch and control whether the various branch-specific variables are automatically set at this time.
This variable specifies under what circumstances creating a branch NAME should result in the variables
branch.NAME.remote being set according to the starting point used to create the branch. If the starting point isn’t a branch, then these variables are never set.
alwaysthen the variables are set regardless of whether the starting point is a local or a remote branch.
true(the default) then the variables are set when the starting point is a remote branch, but not when it is a local branch.
falsethen the variables are never set.
This variable specifies whether creating a branch NAME should result in the variable
branch.NAME.rebase being set to
alwaysthen the variable is set regardless of whether the starting point is a local or a remote branch.
localthen the variable are set when the starting point is a local branch, but not when it is a remote branch.
remotethen the variable are set when the starting point is a remote branch, but not when it is a local branch.
never(the default) then the variable is never set.
Note that the respective commands always change the repository-local values. If you want to change the global value, which is used when the local value is undefined, then you have to do so on the command line, e.g.:
git config --global remote.autoSetupMerge always
For more information about these variables you should also see
the git-config(1) manpage.
user option magit-prefer-remote-upstream
This option controls whether commands that read a branch from the user and then set it as the upstream branch, offer a local or a remote branch as default completion candidate, when they have the choice.
This affects all commands that use
magit-read-starting-point, which includes all commands that change the upstream and many which create new branches.