Is there a way to force Git in to treating .reg
files as text? I am using Git to track my windows registry tweaks and Windows uses .reg
for these files
Create one utf16toascii.py:
#!/usr/bin/env python3
import sys
data = open(sys.argv[-1]).read()
ascii = data.decode('utf-16').encode('ascii', 'replace')
sys.stdout.write(ascii)
Then in bash do:
$ echo "*.reg diff=utf16strings" >> .gitattributes
$ git config --global diff.utf16strings.textconv /path/to/utf16toascii.py
And you're good to diff registry files, as well as Xcode .strings files, or any other utf-16 file.