Re: Confusing error message

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Junio C Hamano <gitster@xxxxxxxxx> writes:

> Phil Hord <phil.hord@xxxxxxxxx> writes:
>
>> I messed something up during a rebase in a moved file (probably
>> because I had rename detection turned off).  So now I want to fix it.
>>
>> I think I have the commit amended right, but to be sure I want to diff
>> the old file and the new file.
>>
>>   $ git diff newfile HEAD^:oldfile
>>   fatal: Path 'oldfile' exists, but not 'oldfile'.
>>   Did you mean 'HEAD^:oldfile' aka 'HEAD^:./oldfile'?
>
> You can feed two blob object names to "git diff", but I do not think
> there is any provision to compare a blob object and a file in the
> working tree.

Ah, actually we do have a bolted-on hack to allow you feeding a blob
and a file, but I think you still need to follow the command line
convention of subcommand name (=diff), any dashed options
(e.g. "-R"), any object names (=HEAD^:oldfile) and then finally
pathnames (e.g. "newfile").

Does "git diff -R HEAD^:oldfile newfile" work?
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]