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

Re: bug: `git pull --rebase` breaks in the presence of pushurls

From
PWPhillip Wood <phillip.wood123@gmail.com>
Date
Dec 8, 2025, 14:30 UTC
Message-ID
<04cc0cc0-155e-422e-b723-b1115c918087@gmail.com>
In-Reply-To
<896e4e13-5d2f-4c5c-ac32-2927dbff91a0@app.fastmail.com>
Hi Kartik
On 07/12/2025 21:55, Kartik Agaram wrote:
Thanks for the easy reproducer
Show 7 quoted lines
> 7. Create commit 3 in working directory A and try unsuccessfully to push it.
> 
>    cd ../A
>    echo c > c
>    git add .
>    git commit -m 'commit 3'
>    git push> > This throws an error when pushing to hub, but successfully pushes to 
mirror.
"git push" updates refs/remotes/origin/master when pushing to "mirror".
> 8. Try to fix the problem:
> 
>    git pull --rebase

"git pull" tries to find the fork point between origin/master and master which is the tip of master because "git push" just updated origin/master to point to the same commit as master.

Unfortunately I'm not sure there is an easy way to fix this. For now I'd recommend doing

	git fetch && git rebase --no-fork-point

instead of running "git pull --rebase". We should perhaps add a "--no-fork-point" option to "git pull" as this isn't the first time that the fork-point has caused problems [1]. There was a patch to do that at [2] but it was lacking tests.

Thanks
Phillip

[1] https://lore.kernel.org/git/6bebcee9-1315-4ec3-a49b-d767f0f67bf7@gmail.com/ [2] https://lore.kernel.org/git/06beff46-cdaf-91c8-e6a3-6557694af618@gmail.com/

Previous: Kartik AgaramNext: Phillip Wood
Message 2 of 13 in “bug: `git pull --rebase` breaks in the presence of pushurls”
  1. Kartik AgaramDec 7, 2025
  2. Phillip WoodDec 8, 2025
  3. Phillip WoodDec 8, 2025
  4. Kartik AgaramDec 8, 2025
  5. Junio C HamanoDec 8, 2025
  6. Kartik AgaramDec 9, 2025
  7. Phillip WoodDec 9, 2025
  8. Phillip WoodDec 10, 2025
  9. Junio C HamanoDec 11, 2025
  10. K JayatheerthDec 11, 2025
  11. Phillip WoodDec 11, 2025
  12. Phillip WoodDec 11, 2025
  13. Phillip WoodDec 11, 2025

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.