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

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

From
Kartik Agaram <ak@akkartik.com>
Date
Dec 7, 2025, 21:55 UTC
Message-ID
<896e4e13-5d2f-4c5c-ac32-2927dbff91a0@app.fastmail.com>
What did you do before the bug happened? (Steps to reproduce your issue)
1. Create a bare hub repo.
  mkdir hub
  cd hub
  git init --bare
  cd ..
2. Create a bare mirror of the hub.
  git clone --bare hub mirror
3. Create a working directory A and set its pushurls to hub and mirror.
  git clone hub A
  cd A
  git remote set-url --add --push origin `dirname $PWD`/hub
  git remote set-url --add --push origin `dirname $PWD`/mirror
4. Create commit 1 and push it to both.
  echo a > a
  git add .
  git commit -m 'commit 1'
  git push
5. Create a second working directory B without pushurls.
  cd ..
  git clone hub B
  cd B
6. Create commit 2 in working directory B and push it to hub.
  echo b > b
  git add .
  git commit -m 'commit 2'
  git push
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.
8. Try to fix the problem:
  git pull --rebase
This completes successfully.
What did you expect to happen? (Expected behavior)
git log in working directory A should show all 3 commits
What happened instead? (Actual behavior)
git log shows commits 1 and 2 (created in B).
What's different between what you expected and what actually happened?
Commit 3 which was locally created is lost after the `git pull --rebase`.
Anything else you want to add:
I first encountered it in git 2.51.0. Also found to be present on HEAD of https://github.com/git/git
Problem exists independent of ~/.gitconfig.
[System Info]
git version:
git version 2.52.0.199.gbdc5341ff6
cpu: x86_64
built from commit: bdc5341ff65278a3cc80b2e8a02a2f02aa1fac06
sizeof-long: 8
sizeof-size_t: 8
shell-path: /bin/sh
rust: disabled
libcurl: 8.16.0
OpenSSL: OpenSSL 3.5.3 16 Sep 2025
zlib: 1.3.1
SHA-1: SHA1_DC
SHA-256: SHA256_BLK
default-ref-format: files
default-hash: sha1
uname: Linux 6.12.48-1-MANJARO #1 SMP PREEMPT_DYNAMIC Fri, 19 Sep 2025 16:11:04 +0000 x86_64
compiler info: gnuc: 15.2
libc info: glibc: 2.42
$SHELL (typically, interactive shell): /usr/bin/zsh
[Enabled Hooks]
Next: Phillip Wood
Message 1 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.