0

I'm trying to diff a .ttx file (bilingual .xml translation file with source (English) strings and target (Spanish) strings and a ton of metadata) with git and it's treating it as a binary so it won't read out the diff, other than what file I changed. I added "*.ttx txt" to my .gitattributes file and still not behaving the way I wanted. Any ideas?

user2347638
  • 1,363
  • 1
  • 8
  • 7
  • 2
    Have you tried `git diff -a foo.ttx` ? The `-a` argument to `git diff` forces `git` to treat all files as text. – Tuxdude May 03 '13 at 16:34
  • @Tuxdude that didn't work--just a bunch of garbled characters in my Git Bash window. I did however answered my own question. These files are encoded UTF-16LE and git treats these as binary. Files encoded UTF-16 encoding are most easily diffed with an external diff tool. I use p4merge becuase it's free and easy to set up. [link](https://gist.github.com/tony4d/3454372) on Mac and [link](http://stackoverflow.com/questions/426026/git-on-windows-how-do-you-set-up-a-mergetool) for windows. – user2347638 Jan 15 '14 at 18:50
  • @user2347638 Than formulate this as an answer and accept it. Stackoverflow practise. – openCage Jun 25 '14 at 07:09

1 Answers1

0

These files are encoded UTF-16LE and Git treats them as binary. Files encoded UTF-16 are most easily diffed with an external diff tool. I use p4merge because it's free and easy to set up.

mhcuervo
  • 2,610
  • 22
  • 33
user2347638
  • 1,363
  • 1
  • 8
  • 7