Re: git mv after the fact
- From
- Frieder Hannenheim <mail@fhannenheim.net>
- Date
- May 26, 2026, 16:50 UTC
- Message-ID
- <1343ca51-c8a8-4a86-9b46-02468a92b98f@fhannenheim.net>
- In-Reply-To
- <CAPx1Gvd9+z0th9whCbcA60_bWproPp+kwp3qDmhQOe4G=0=E6A@mail.gmail.com>
In my particular use case I changed a patch to be a git patch with a commit message and different filename so the move was not discovered automatically. But I'm not sure if I staged the files so maybe it would have been discovered.
Frieder
On 26.05.26 18:40, Chris Torek wrote:
Show 15 quoted lines
> 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. > > 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