Andrey Yaskulsky Andrey Yaskulsky - 1 year ago 208
Git Question

mark folder as binary in .gitattributes

I have to include some folder to a repository but I don't want my git to modify it's content (line endings etc)

I already have some files that are marked as binary files in .gitattributes i.e. images:

*.png binary

but this rule specifies certain category of files - png files, however I want to achieve something like that:

/folder_which_i_want_to_mark_as_binary binary

Answer Source

In order to fix line endings you can apply following instructions

UNIX System

git config --global core.autocrlf input

Windows System

git config --global core.autocrlf true

If you want to treat as binary everything in a particular folder, in .gitattributes you could add

folder/* binary 

Note: folder must be the name of your folder.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download