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

Minor issue: "git remote rename origin skybuck_repository" removes comments behind refspecs in .git/config

From
Skybuck Flying <skybuck2000@hotmail.com>
Date
Aug 1, 2025, 17:58 UTC
Message-ID
<DB7PR02MB4265AB8791FADBBC5968C74BB326A@DB7PR02MB4265.eurprd02.prod.outlook.com>
(Before rename command): The .git/config file:
<snip>
[remote "origin"]
      url = https://github.com/SkybuckFlying/RamDiskSupportUtility.git
      fetch = +refs/heads/*:refs/remotes/origin/*                       ; All remote branches
      fetch = +refs/tags/*:refs/tags/*                            ; All remote tags
      fetch = +refs/notes/*:refs/remotes/origin/notes/*                 ; All remote notes (map to remote-tracking notes)
      fetch = +refs/pull/*/head:refs/remotes/origin/pull/*/head         ; GitHub/GitLab PR heads
      ; fetch = +refs/changes/*:refs/remotes/origin/changes/*           ; Gerrit changes (commented out as per your request)
      ; fetch = +refs/meta/config:refs/remotes/origin/meta/config             ; Versioned remote config (if applicable) 
<snip>
(Then rename command):
git remote rename origin skybuck_repository
(After rename command):
The .git/config file:
<snip>
[remote "skybuck_repository"]
      url = https://github.com/SkybuckFlying/RamDiskSupportUtility.git
      fetch = +refs/heads/*:refs/remotes/skybuck_repository/*
      fetch = +refs/tags/*:refs/tags/*
      fetch = +refs/notes/*:refs/remotes/skybuck_repository/notes/*
      fetch = +refs/pull/*/head:refs/remotes/skybuck_repository/pull/*/head
      ; fetch = +refs/changes/*:refs/remotes/origin/changes/*           ; Gerrit changes (commented out as per your request)
      ; fetch = +refs/meta/config:refs/remotes/origin/meta/config             ; Versioned remote config (if applicable) 
<snip>

Notice how the git rename command removed the comments, this is somewhat unfortunately. Fortunately a copy of the original is still available.

Further tiny little issue, the command in comments not changed, but I can do that manually, leave as is, since it might contain info in case somebody wants to revert things ;)
Bye for now,
  Skybuck Flying !
Message 1 of 1 in “Minor issue: "git remote rename origin skybuck_repository" removes comments behind refspecs in .git/config”
  1. Skybuck FlyingAug 1, 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.