Why does git pull use rebase not merge?

Hi,
when i do a “git pull” i get the following message:

@up@bup-VirtualBox ~/test $ git pull
Cannot pull with rebase: You have unstaged changes.
Please commit or stash them.

From what i read then merge should be the default option. I need to manually set the --no-rebase option which is very annoying.

What could cause this issue?

Thanks in advance!

Hi @bupthebroker,

Rebasing keeps the commit history tidy and linear, while merge groups together commits which you may not necessarily want associated.

One option would be to run the following command:

git pull --rebase --autostash

that will let you rebase while automatically stashing your existing non-committed work so you don’t lose it.

​If there’s anything else I can help you with, let me know; so happy to help further!

Kindest regards,
Matthew

Most likely this is because you have pull.rebase set to true in your Git configuration. But since this situation can come about for multiple reasons, you’ll need to check your entire Git configuration by using the command:

git config --show-origin --get-regexp rebase

This will show you the lines in your configuration (and which configuration file they’re in) that mention the term rebase. You can then refer to the Git configuration documentation linked above to see what each means, whether you want to change them, and to what.