git/list[1] front-page[2] threads[3] people[4] search[5] about
 

git pull --rebase=preserve is always rebasing something, even on up-to-date branch

From
MMMikhail Matrosov <mikhail.matrosov@gmail.com>
Date
Sep 17, 2018, 20:35 UTC
Message-ID
<CADhDkKwHp0dR7PPLV6UZDmSO9ERW7Opym3FSD64XXTg-QK65bw@mail.gmail.com>
Please try the following:
mmatrosov@Mikhail-PC:~/test$ git init --bare server
Initialized empty Git repository in /home/mmatrosov/test/server/
mmatrosov@Mikhail-PC:~/test$ git clone server local
Cloning into 'local'...
warning: You appear to have cloned an empty repository.
done.
mmatrosov@Mikhail-PC:~/test$ cd local
mmatrosov@Mikhail-PC:~/test/local$ echo a > a && git add . && git commit -m A
[master (root-commit) a34c21f] A
 1 file changed, 1 insertion(+)
 create mode 100644 a
mmatrosov@Mikhail-PC:~/test/local$ git push
Counting objects: 3, done.
Writing objects: 100% (3/3), 205 bytes | 0 bytes/s, done.
Total 3 (delta 0), reused 0 (delta 0)
To /home/mmatrosov/test/server
 * [new branch]      master -> master
mmatrosov@Mikhail-PC:~/test/local$ git pull
Already up-to-date.
mmatrosov@Mikhail-PC:~/test/local$ git pull --rebase=preserve
Rebasing (1/1)
Successfully rebased and updated refs/heads/master.

As you can see, running bare "git pull" just tells me everything is up to date. However, running "git pull --rebase=preserve" triggers rebasing of something. It wont be a problem if it didn't take significant time (especially on Windows). Why this rebase happens? It is completely redundant and slows down the pull operation. Looks like a bug to me.

Note that it is important to me, because I want to set "git config --global pull.rebase preserve". But because of this issue, pulling on an up-to-date repository takes a lot of time. Which is very frustrating.

Tested with:
* git version 2.19.0.windows.1 in Windows 10 Version 1803
* git version 2.7.4 in Ubuntu 16.04.3 LTS (inside WSL)

----- Best regards, Mikhail Matrosov

Next: Johannes Schindelin
Message 1 of 2 in “git pull --rebase=preserve is always rebasing something, even on up-to-date branch”
  1. Mikhail MatrosovSep 17, 2018
  2. Johannes SchindelinNov 16, 2018

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.