0

In a local Git repository for a project, when the git log --stat command is issued, the following is a sample of lines that are outputted:

enter image description here

The last 2 lines look normal but why do the first 2 lines show Bin 0 -> ___ bytes? Those 2 files were scripted out of a MS SQL Server database using SQL Server Management Studio and consist of INSERT statements to populate database tables with data. They are both around 1,950 lines long, if that matters. Also, this is on a Windows 10 machine. I would've expected them to be handled the same way as other .sql files (like the last 2 on the list).

knot22
  • 2,648
  • 5
  • 31
  • 51
  • Are they newly-added in this commit? – ElpieKay Nov 06 '20 at 02:57
  • Yes they were added in this commit. – knot22 Nov 06 '20 at 03:00
  • It seems the newly-added sql files are considered as binaries and the original ones as text files. Run `file Data/Data_AsScriptedFromDB_2015-03-10.sql` and `file Scripts/2013-11-24_script2_AlterTables.sql` to check if the outputs are the same. – ElpieKay Nov 06 '20 at 03:05
  • Did you define some of the sql files, whose names match a certain pattern, as text files in `.gitattributes`? – ElpieKay Nov 06 '20 at 03:13

1 Answers1

0

Using Notepad++ it was possible to see that the 2 files being treated as binary files were encoded as UCS-2 LE BOM:

enter image description here

For each file, choosing the Convert to UTF-8 option and then saving the file allowed Git to recognize the files as text files.

This was a useful thread to figure out this issue.

knot22
  • 2,648
  • 5
  • 31
  • 51