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

Re: git mv after the fact

From
Ben Knoble <ben.knoble@gmail.com>
Date
May 26, 2026, 21:29 UTC
Message-ID
<85D5E150-BD78-4FC5-83DC-10DEBAC6EA4B@gmail.com>
In-Reply-To
<CAPx1Gvd9+z0th9whCbcA60_bWproPp+kwp3qDmhQOe4G=0=E6A@mail.gmail.com>
Show 9 quoted lines
> Le 26 mai 2026 à 12:46, Chris Torek <chris.torek@gmail.com> a écrit :
> 
> On Tue, May 26, 2026 at 6:18 AM Frieder Hannenheim <mail@fhannenheim.net> wrote:
>> I'd like to propose a new flag for git mv, that updates the index
>> like git mv normally would but does not move the file. ...
> 
> You may already know this, but technically no flag is needed:
> you can just "git add" the new name and "git rm" the old one,
> with the same effect.
Or indeed, « git add old new » should also work, I think.
Show 8 quoted lines
> A flag for "git mv" would be convenient (and slightly more
> efficient, not in terms of storage but in terms of CPU time
> spent discovering that the contents under the new name
> already exist in the object database). But Git will discover
> the rename on its own in the usual way regardless of how
> you get to that point.
> 
> Chris
Previous: Frieder HannenheimNext: Junio C Hamano
Message 4 of 10 in “git mv after the fact”
  1. Frieder HannenheimMay 26, 2026
  2. Chris TorekMay 26, 2026
  3. Frieder HannenheimMay 26, 2026
  4. Ben KnobleMay 26, 2026
  5. Junio C HamanoMay 27, 2026
  6. Chris TorekMay 27, 2026
  7. Junio C HamanoMay 27, 2026
  8. Ben KnobleMay 28, 2026
  9. Junio C HamanoMay 28, 2026
  10. Tim TassonisMay 27, 2026

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.