Skip to content

gitattributes/gitattributes

Folders and files

NameName
Last commit message
Last commit date

Latest commit

46a8961 · Jan 21, 2025
Feb 13, 2024
Jul 17, 2023
Dec 27, 2023
Dec 27, 2023
Mar 10, 2021
Aug 19, 2023
Apr 18, 2019
May 4, 2024
Apr 4, 2023
Jul 7, 2022
Mar 22, 2024
Apr 22, 2023
Dec 11, 2023
Jun 20, 2024
Nov 18, 2020
Jul 17, 2019
Mar 9, 2019
Jan 21, 2025
Jan 3, 2025
Apr 17, 2019
Sep 23, 2022
May 19, 2020
Mar 9, 2019
Nov 26, 2021
Apr 20, 2019
Dec 27, 2023
Jul 17, 2019
Apr 20, 2019
Nov 20, 2021
Dec 7, 2022
Nov 20, 2021
Dec 11, 2023
Apr 19, 2019
Oct 8, 2021
Dec 27, 2023
Jul 6, 2019
Jul 17, 2023
Oct 22, 2024
Oct 14, 2020
Dec 11, 2023
Dec 11, 2023

Repository files navigation

A Collection of Useful .gitattributes Templates

Similarly to the .gitignore Templates, we're trying to build templates for .gitattributes.

Common.gitattributes contains general exclusions that may apply to any project. Consider including them if they are applicable to your project.

You can use this or this handy dandy generator to generate your gitattributes files on the fly based on files inside of this repository.

CI step

To check if all files have a corresponding rule in .gitattributes, this script can be used:

missing_attributes=$(git ls-files | git check-attr -a --stdin | grep 'text: auto' || printf '\n')

if [ -n "$missing_attributes" ]; then
  printf '%s\n%s\n' '.gitattributes rule missing for the following files:' "$missing_attributes"
else
  printf '%s\n' 'All files have a corresponding rule in .gitattributes'
fi

You can also use the checked-in ./check.sh which has more features. Run ./check.sh --help for the available options.

Contributing

Please contribute by forking and sending a pull request.

Also please only modify one file per commit. This'll make merging easier for everyone.

For more information on gitattributes: gitattributes(5) and for Github-specific grammar: Linguist docs