git config pull.rebase false

Configures Git to merge instead of rebasing when pulling changes.

This command updates your Git settings so that every time you run git pull, Git will perform a merge by default rather than a rebase, helping you keep your commit history in a familiar merge-based workflow.

It works by using the config subcommand to set the pull.rebase key to false in your repository’s configuration file, which tells Git not to use the --rebase option during pulls. You can add --global to apply this setting across all your repositories or --local to be explicit about affecting only the current repo.

You can reverse this behavior with git config pull.rebase true or enable it just for one pull via git pull --rebase; similarly, use git config --global pull.rebase merges to rebase but keep merge commits. Other related commands include git pull --no-rebase for a one-off merge pull and configuring fast-forward only merges with git config pull.ff only.

Related commands

Welcome to GitExamples!

Sign in to enable bookmarking, reminders, progress-tracking and more...