* git incorrectly infers rename i.e. (delete file1 + creation of new file2) != (file => file2)
@ 2011-04-22 0:31 Mike
2011-04-22 5:22 ` B Smith-Mannschott
0 siblings, 1 reply; 2+ messages in thread
From: Mike @ 2011-04-22 0:31 UTC (permalink / raw)
To: git
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 :)
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: git incorrectly infers rename i.e. (delete file1 + creation of new file2) != (file => file2)
2011-04-22 0:31 git incorrectly infers rename i.e. (delete file1 + creation of new file2) != (file => file2) Mike
@ 2011-04-22 5:22 ` B Smith-Mannschott
0 siblings, 0 replies; 2+ messages in thread
From: B Smith-Mannschott @ 2011-04-22 5:22 UTC (permalink / raw)
To: Mike; +Cc: git
On Fri, Apr 22, 2011 at 02:31, Mike <xandrani@gmail.com> wrote:
> Hi
>
> I deleted a file called 'class.NumberOfResultsCache.php' and created a
> completely different file called
> 'cgi-bin/___php/class.NumberOfResults.php'.
"completely different" in what they mean to you, or in their actual content?
Please be more specific.
> 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.
Git doesn't care about individual files or renames, it tracks whole trees.
What it shows as a rename is just its best guess based on the contents
of the two files.
> How do I get git to do this? Apologies for a 'noob' question. Only
> been using the superb git for a couple of weeks!
You could commit the deletion and the add separately, but before doing
that, why is it important to you that git not show this change as a
potential rename?
// Ben
> Thanks :)
> --
> To unsubscribe from this list: send the line "unsubscribe git" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2011-04-22 5:22 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-04-22 0:31 git incorrectly infers rename i.e. (delete file1 + creation of new file2) != (file => file2) Mike
2011-04-22 5:22 ` B Smith-Mannschott
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).