git pull
combines a git fetch
and git merge
.
There are three levels of configuration for default pull
behavior:
pull.rebase
which is equivalent to git pull --rebase
(combine a series of commits to a new base commit):
When true
(git config branch.master.rebase true
) rebase branches on top of the fetched branch, instead of merging the default branch from the default
branch.autosetuprebase
(git config --global branch.autosetuprebase always
):
When a new branch is created with git branch
or git checkout
that tracks another branch, this variable tells Git to set up pull to rebase instead of merge When never, rebase is never automatically set to true. When local, rebase is set to true for tracked branches of other local branches. When remote, rebase is set to true for tracked branches of remote-tracking branches. When always, rebase will be set to true for all tracking branches. See "branch.autoSetupMerge" for details on how to set up a branch to track another branch. This option defaults to never.
branch.<branchname>.rebase
:
When true, rebase the branch on top of the fetched branch, instead of merging the default branch from the default remote when "git pull" is run.
As a side git config --help
is your friend.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…