Useful .gitattributes defaults for Beanstalk Git

Posted in Notes on 25 May 2015

This post has been archived

The content of this post has not been updated since 2015, and may be out of date. Extra care should be taken with any code provided.

Some useful copy-and-paste lines for the .gitattributes file when using Beanstalk Git.

Image and other binary files

Upload and store images as binary files, rather than text – the default. This will stop images being corrupted upon commit/push.

*.png binary
*.gif binary
*.jpg binary
*.jpeg binary

Dealing with line endings

Handle line endings automatically for files detected as text and leave all files detected as binary untouched.

* text eol=lf

The above will handle all files NOT found below it. The lines below should be added as the files are text and should be normalized (Convert crlf => lf)

*.gitattributes text eol=lf

.gitignore text eol=lf

Related Notes Posts

October 2024

What's going on between WordPress and WP Engine?

The disagreement between WordPress and WP Engine has sparked considerable debate within the WordPress community and could have important implications for users of the WordPress... Continue reading

August 2024

Guide to writing a good cookie policy (UK)

A cookie policy informs website visitors about the cookies your website uses, why they are used, and how users can control them. > **The information... Continue reading

May 2024

Email and newsletter deliverability best practice

Email deliverability refers to the ability of an email to successfully reach the recipient's inbox, rather than being marked as spam or bouncing back. High... Continue reading

More Notes Posts