← All text tools

.gitattributes Generator

Build a .gitattributes file for line endings, binary files, Git LFS, diff drivers, GitHub language statistics and export-ignore rules.

  • Free
  • No sign-up
  • Works on any device

About .gitattributes Generator

Build a .gitattributes file from checkboxes and short lists. It covers line ending rules (text=auto, eol=lf for shell scripts, eol=crlf for Windows scripts), binary files, Git LFS patterns written the way git lfs track writes them, better diff hunks through the built-in language drivers, and linguist attributes that hide vendored or generated files from GitHub's language bar. It also adds export-ignore for files you do not want in git archive releases. A folder written with a trailing slash is turned into folder/**, because gitattributes does not match directories with a slash alone.

How to use .gitattributes Generator

  1. Tick the line ending options and list the patterns that are binary or should use Git LFS.
  2. Add diff drivers, vendored or generated paths and anything to leave out of release archives.
  3. Copy the result into a file named .gitattributes at the top of your repository and commit it.

Why use this tool?

Also known as

Frequently asked questions

What does * text=auto do?

Git detects text files, stores them with LF line endings in the repository, and converts them to the platform's native ending when they are checked out. It is the usual protection against mixed line endings.

Do I still need to run a command for Git LFS?

Yes. The attribute lines only describe which files LFS handles. Each person needs git lfs installed and git lfs install run once, and files already committed must be migrated.

What is linguist-vendored for?

GitHub's Linguist leaves files with that attribute out of the repository language statistics and collapses them in diffs, so third-party code does not make a Python project look like JavaScript.

Is .gitattributes Generator free?

Yes. .gitattributes Generator on Toolipedia is free to use, with no sign-up and no watermark.

Is it safe to use?

Yes. Everything is worked out in your browser, and nothing you enter is sent to our server.

Does it work on my phone?

Yes. It works in any modern browser on Android and iPhone, as well as on tablets and computers. There's nothing to install.

Do I need an account?

No. Just open the page and use the tool. There's no sign-up and no email needed.

Can I put .gitattributes Generator on my own website?

Yes. Use the Embed on your site button under the tool to copy a short piece of code and paste it into your page. It is free, needs no account, and the tool keeps working inside your page.

Related tools