My diff looks like:
--- a/binarytest copy.png
+++ /dev/null
@@ -1,863 +0,0 @@\n-8950 4e47 0d0a 1a0a 0000 000d 4948 4452
-0000 00c8 0000 00c8 0803 0000 009a 865e
-ac00 0000 0970 4859 7300 000b 1300 000b
-1301 009a 9c18 0000 0a4f 6943 4350 5068
-6f74 6f73 686f 7020 4943 4320 7072 6f66
-696c 6500 0078 da9d 5367 5453 e916 3df7
-def4 424b 8880 944b 6f52 1508 2052 428b
-8014 9126 2a21 0910....
This is basically removing a binary file. How can I parse this to always know that a binary file has been removed?
I’m trying to see if it’s a binary file that’s been removed as opposed to a text file. Is that possible?
I just did a few simple checks.
When I added a removed a binary file and then did a
git diff HEAD^I get results as follows:When I then removed a non-binary file and did the same
git diff HEAD^, I get the following results:My suggestion is to use the
git diffcommand VS straightdiff. Git will tell you if it was a binary file or not straight in its diff (i.e. there is no ‘removed’ text… just a removed file).