Skip to content

Commit ad7ce55

Browse files
authored
Merge pull request #1461 from HonkingGoose/feature/add-note-how-to-get-rid-of-warnings-on-git-pull
2 parents 683fe84 + d81ce81 commit ad7ce55

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

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

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,18 @@ 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, `git pull` will give a warning if the `pull.rebase` variable is not set.
133+
Git will keep warning you until you set the variable.
134+
135+
If you want the default behavior of git (fast-forward if possible, else create a merge commit):
136+
`git config --global pull.rebase "false"`
137+
138+
If you want to rebase when pulling:
139+
`git config --global pull.rebase "true"`
140+
====
141+
130142
[[_pushing_remotes]]
131143
==== Pushing to Your Remotes
132144

0 commit comments

Comments
 (0)