Caution: This post was published in 2015 and may contain information, techniques, or code examples that are no longer current. Please double-check official documentation and modern best practices before using anything from this article.

Useful .gitattributes defaults for Beanstalk Git

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

Latest posts

Website Speed Improvements

Website speed has become one of the most significant factors in determining user satisfaction and search performance. A slow-loading website can frustrate visitors, damage your brand’s credibility and, ultimately, cost…

Continue reading

Structured data for SEO

Adding structured data to a website is one of those steps that often gets overlooked, yet it can make a real difference to how a site performs in search engines.…

Continue reading

Using WordPress as a static site generator

Static site generators have gained significant traction amongst developers, designers, and businesses seeking faster, more secure websites. Unlike traditional dynamic sites, which rely on a database to deliver content on…

Continue reading

Simple steps to protect your privacy online

In today’s digital world, protecting your privacy online has become essential. With personal data constantly being shared, stored, and potentially accessed by unauthorised parties, safeguarding your privacy can help you…

Continue reading