Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

git pull : error: preserve: 'preserve' superseded by 'merges' fatal: invalid value for 'pull.rebase': 'preserve'

Tags:

git

ubuntu

I'm used to using git, and this is the first time I get this error that I don't understand.

After a fresh clone on Linux

# git status
On branch master
Your branch is up-to-date with 'origin/master'.

nothing to commit, working tree clean

Even if I know that all is updated :

# git pull
error: preserve: 'preserve' superseded by 'merges'
fatal: invalid value for 'pull.rebase': 'preserve'
# 

# git --version
git version 2.37.1
#

Why this ?

like image 591
troubadour Avatar asked Oct 24 '25 17:10

troubadour


1 Answers

Try git config --list --show-origin --show-scope

In ubuntu 22.04 a newer version of git deprecated "pull.rebase=preserve"

Git typically has config:

  • system level in /etc/gitconfig
  • global level in /home/<username>/.gitconfig
  • local level in .git/config of the repo you are in

I suspect the repo you are in has the old settings so you can run:

git config --local pull.rebase merges

or if you see it in system or global modify the above command to the correct scope.

like image 97
Ace.C Avatar answered Oct 26 '25 08:10

Ace.C



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!