git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* bug: `git pull --rebase` breaks in the presence of pushurls
@ 2025-12-07 21:55 Kartik Agaram
  2025-12-08 14:30 ` Phillip Wood
  0 siblings, 1 reply; 13+ messages in thread
From: Kartik Agaram @ 2025-12-07 21:55 UTC (permalink / raw)
  To: git

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]

^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2025-12-11 19:39 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-12-07 21:55 bug: `git pull --rebase` breaks in the presence of pushurls Kartik Agaram
2025-12-08 14:30 ` Phillip Wood
2025-12-08 16:04   ` Phillip Wood
2025-12-08 16:43   ` Kartik Agaram
2025-12-08 22:24   ` Junio C Hamano
2025-12-09  1:48     ` Kartik Agaram
2025-12-09 16:03       ` Phillip Wood
2025-12-10 14:25     ` Phillip Wood
2025-12-11  3:21       ` Junio C Hamano
2025-12-11  5:35         ` K Jayatheerth
2025-12-11 15:54           ` Phillip Wood
2025-12-11 19:39             ` Phillip Wood
2025-12-11 15:56         ` Phillip Wood

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).