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

git incorrectly infers rename i.e. (delete file1 + creation of new file2) != (file => file2)

From
MMike <xandrani@gmail.com>
Date
Apr 22, 2011, 00:31 UTC
Message-ID
<BANLkTimqk5xP6X7NcGqZ6w05GfYe02iAhA@mail.gmail.com>
Hi

I deleted a file called 'class.NumberOfResultsCache.php' and created a completely different file called 'cgi-bin/___php/class.NumberOfResults.php'. I deleted the file using rm followed by 'git rm'.

When I do a 'git status' I now get told:
   renamed:    cgi-bin/___php/class.NumberOfResultsCache.php ->
cgi-bin/___php/class.NumberOfResults.php

However I want to commit 'class.NumberOfResultsCache.php' as having been deleted, and I want to commit 'class.NumberOfResults.php' as a brand new file.

How do I get git to do this? Apologies for a 'noob' question. Only been using the superb git for a couple of weeks!

Thanks :)
Next: B Smith-Mannschott
Message 1 of 2 in “git incorrectly infers rename i.e. (delete file1 + creation of new file2) != (file => file2)”
  1. MikeApr 22, 2011
  2. B Smith-MannschottApr 22, 2011

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.