Ok the scenario is as follows . . .
git log filename
would sufficegit log--follow filename
--follow
commands gives me the full history but I unfortunately I am unable to compare two SHAs in this history for a particular fileFor example, I can run a git diff SHA1 SHA2
: This will return all the file changes made between these commits.
However, if I try to bring it down to the file level to compare (git diff SHA1 SHA2 filename
) it returns nothing !
(Although the previous diff of the SHAs show changes within this file)
Has Anyone come across this before ..
I understand that between the commits this file has moved so I have tried variations like
git diff --follow SHA1 SHA2 filename
to no avail.
Has anyone else experienced this and if so, do they have a solution to it ?
Another option worth looking into is -M
. However, in the likely case that this doesn't help, either, you can manually tell git the correct file paths like this:
git diff SHA1:path/to/file1 SHA2:path/to/file2
(The paths need to be relative to the top level of the repo)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With