git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* `git remote rename` does not work when `refs/remotes/server/HEAD` is unborn (when right after `git remote add -m`)
@ 2025-07-24  9:59 Han Jiang
  2025-07-24 10:45 ` Jeff King
  0 siblings, 1 reply; 10+ messages in thread
From: Han Jiang @ 2025-07-24  9:59 UTC (permalink / raw)
  To: Git Mailing List

What did you do before the bug happened? (Steps to reproduce your issue)

mkdir --parents -- './server' './client';
git -C './server' init --bare './repo.git'
branch_default_name="$(git -C './server/repo.git' branch
--show-current)"; echo "$branch_default_name"
git --git-dir='./server/repo.git' --work-tree='.' commit
--message="$((++number))" --allow-empty
git -C './client' init './repo'
cd './client/repo'
git remote add -m "$branch_default_name" server 'file://'"$(realpath
'../../server/repo.git')"
git remote --verbose
git config list --local --show-scope --show-origin
git symbolic-ref 'refs/remotes/server/HEAD'
git remote rename server server2
git config list --local --show-scope --show-origin
git symbolic-ref 'refs/remotes/server2/HEAD'
git symbolic-ref 'refs/remotes/server/HEAD'

What did you expect to happen? (Expected behavior)

`git symbolic-ref 'refs/remotes/server/HEAD'` outputs
"refs/remotes/server/master";
`git symbolic-ref 'refs/remotes/server2/HEAD'` outputs
"refs/remotes/server2/master".

What happened instead? (Actual behavior)

`git symbolic-ref 'refs/remotes/server/HEAD'` outputs
"refs/remotes/server/master";
`git symbolic-ref 'refs/remotes/server2/HEAD'` outputs "fatal: ref
refs/remotes/server2/HEAD is not a symbolic ref".
`git symbolic-ref 'refs/remotes/server/HEAD'` outputs
"refs/remotes/server/master".

What's different between what you expected and what actually happened?

Anything else you want to add:

Please review the rest of the bug report below.
You can delete any lines you don't wish to share.


[System Info]
git version:
git version 2.50.1.windows.1
cpu: x86_64
built from commit: 4d32d83913170b86f9753fca10e75cdb2223d1cc
sizeof-long: 4
sizeof-size_t: 8
shell-path: D:/git-sdk-64/usr/bin/sh
feature: fsmonitor--daemon
libcurl: 8.14.1
OpenSSL: OpenSSL 3.2.4 11 Feb 2025
zlib: 1.3.1
SHA-1: SHA1_DC
SHA-256: SHA256_BLK
uname: Windows 10.0 26100
compiler info: gnuc: 15.1
libc info: no libc information available
$SHELL (typically, interactive shell): C:\Program Files\Git\usr\bin\bash.exe


[Enabled Hooks]
not run from a git repository - no hooks to show

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

end of thread, other threads:[~2025-07-28  6:05 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-07-24  9:59 `git remote rename` does not work when `refs/remotes/server/HEAD` is unborn (when right after `git remote add -m`) Han Jiang
2025-07-24 10:45 ` Jeff King
2025-07-24 11:58   ` Patrick Steinhardt
2025-07-24 13:03     ` Patrick Steinhardt
2025-07-24 18:38       ` Junio C Hamano
2025-07-25  8:00         ` Patrick Steinhardt
2025-07-25 11:02       ` Jeff King
2025-07-25 11:13         ` Jeff King
2025-07-28  6:05           ` Patrick Steinhardt
2025-07-28  6:05         ` Patrick Steinhardt

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).