6

I know how to force Git to treat e.g. JPEG file as binary using gitattributes but what is actually the default list of binary files for Git? Or is there any? I found what seems to be the system-wide gitattributes file on my system and this is its contents:

*.doc   diff=astextplain
*.DOC   diff=astextplain
*.docx  diff=astextplain
*.DOCX  diff=astextplain
*.dot   diff=astextplain
*.DOT   diff=astextplain
*.pdf   diff=astextplain
*.PDF   diff=astextplain
*.rtf   diff=astextplain
*.RTF   diff=astextplain

Does that mean that images are by default not treated as binary files?

EDIT: there could also theoretically be some "guessing" algorithm involved but I haven't found any details on it.

Borek Bernard
  • 50,745
  • 59
  • 165
  • 240
  • Good question! Did you see [this](http://git-scm.com/book/en/v2/Customizing-Git-Git-Attributes) ? – Unapiedra Apr 03 '15 at 15:14
  • Yes I have but I don't think it answers my question. – Borek Bernard Apr 03 '15 at 15:15
  • 2
    This is interesting: http://stackoverflow.com/a/6134127/21728. Supposedly Git looks at first 8000 bytes and tries to find null byte in it. In our case, all the images contain null bytes there and Git still messes with their EOL conversion when the only rule we have in our .gitattributes is `* text=auto eol=lf`. – Borek Bernard Apr 03 '15 at 15:16
  • 1
    possible duplicate of [How to determine if Git handles a file as binary or as text?](http://stackoverflow.com/questions/6119956/how-to-determine-if-git-handles-a-file-as-binary-or-as-text) – Richard Hansen Apr 15 '15 at 19:10

0 Answers0