I work in a team on a development project that includes files created in SQL Server Management Studio (SSMS). The default file encoding for SSMS is: Codepage 1200 (Little-endian UTF-16).
Git for Windows recognises these files as binary. It is unable to show diff views of the files and it cannot merge files (remote merges overwrite the local version).
We are able to change the default encoding in SSMS easily. However, we prefer not to have risk of any UTF-16 files being committed - as they cause havoc in our source control and release mgmt processes.
This stack overflow post describes how to use Clean/Smudge filters to convert UTF-16 files to UTF-8 on the fly when committed, using two tools by GnuWin32: iconv
, file
.
This works well and we have been using it with msysgit 1.9.5 preview for a long time. However, this version is deprecated and the newer Git has more and more features that we require as a team. The problem is that this workaround relies on updating two files: Git\etc\gitattributes
and Git\etc\gitconfig
. These 2 files do not exist in Git for Windows 2.x
How can I add UTF-16 support to Git 2.x? Either by adapting the workaround for described for Git 1.x or by any other means.