Skip to content

Commit eeca187

Browse files
committed
Add note: how to set the pull.rebase variable
From version 2.27 onward, git will give a warning when the pull.rebase variable is not set. This commit adds a note detailing how to configure the pull.rebase variable to get rid of this warning.
1 parent 683fe84 commit eeca187

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

book/02-git-basics/sections/remotes.asc

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,19 @@ If your current branch is set up to track a remote branch (see the next section
127127
This may be an easier or more comfortable workflow for you; and by default, the `git clone` command automatically sets up your local `master` branch to track the remote `master` branch (or whatever the default branch is called) on the server you cloned from.
128128
Running `git pull` generally fetches data from the server you originally cloned from and automatically tries to merge it into the code you're currently working on.
129129

130+
[NOTE]
131+
====
132+
From git version 2.27 onward:
133+
`git pull` will give a warning if the pull.rebase variable is not set.
134+
Git will keep warning you until you set the variable.
135+
136+
If you want the default behavior of git (fast-forward if possible, else create a merge commit):
137+
`git config --global pull.rebase "false"`
138+
139+
If you want to rebase when pulling:
140+
`git config --global pull.rebase "true"`
141+
====
142+
130143
[[_pushing_remotes]]
131144
==== Pushing to Your Remotes
132145

0 commit comments

Comments
 (0)