About this tool
Generate a .gitattributes file for line-ending normalization, Git LFS tracking, binary marking, export-ignore and diff drivers.
This generator builds a .gitattributes file using the exact attribute syntax from the official git documentation: text=auto for line-ending normalization, the binary macro for images and archives, filter=lfs diff=lfs merge=lfs -text for Git LFS tracking, export-ignore for git archive, and diff=<driver> for custom diff drivers. It is aimed at developers on mixed Windows, macOS and Linux teams who want line endings and binary handling settled once, at the repository level, instead of per-machine core.autocrlf settings.
Open Gitattributes Generator on AltFTool — it loads instantly in your browser.
Provide your input — an image, text, or data.
Let the tool analyze or generate the result.
Review, refine, and reuse the output wherever you need it.
text=auto in .gitattributes overrides everyone's core.autocrlf, so behaviour is identical on every clone.
Emits the exact filter=lfs diff=lfs merge=lfs -text line that git lfs track writes.
One click keeps .bat/.cmd files CRLF and shell scripts LF so nothing breaks at execution time.
It tells git to detect which files are text and store them with LF line endings in the repository, converting to the platform's native ending on checkout. Because it lives in the repository, it applies to every contributor and overrides their personal core.autocrlf setting — GitHub's own documentation recommends this as the baseline line-ending rule.
Add the pattern followed by the binary macro, for example *.png binary. That macro expands to -text -diff -merge, so git will never normalize the file's bytes, show a text diff for it, or attempt a content merge — preventing corruption of images, fonts and archives.
Running git lfs track "*.psd" writes *.psd filter=lfs diff=lfs merge=lfs -text. The filter attribute routes the file through the LFS clean/smudge filter so only a small pointer file is stored in git, while -text stops any line-ending conversion of the pointer's target.
Yes — run git add --renormalize . and commit. Attributes only affect files as they are added, so files already in the index keep their old line endings until they are renormalized. Expect a one-time commit that touches every file whose stored line endings change.