Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Git mark file as binary to avoid line separator conversion

I have a text file with sample data which I want to put under Git control (on Windows). How can I tell Git to treat this file as binary, so it does not convert line separators (like for the other/text files in the repository).

like image 268
Mot Avatar asked Nov 03 '11 12:11

Mot


2 Answers

Write this in .gitattributes (in the file’s directory or higher up):

myfile.bin -text

See the manual for more explanation.

like image 111
Josh Lee Avatar answered Nov 15 '22 19:11

Josh Lee


While -text in .gitattributes did not worked,

myfile.bin binary

did.

like image 5
sevenforce Avatar answered Nov 15 '22 18:11

sevenforce