1
0
mirror of https://github.com/gitattributes/gitattributes.git synced 2025-01-22 00:08:52 -05:00
Go to file
Jozef Izso 46a8961ad7
Merge pull request #235 from runningcode/patch-1
Add handling for windows .bat files
2025-01-21 14:49:30 +01:00
.github Bump pre-commit/action from 3.0.0 to 3.0.1 2024-02-13 10:20:59 -08:00
community style: Align attributes 2023-12-27 13:15:06 -08:00
Global Create community and Global folders 2023-07-17 14:44:14 -05:00
.gitattributes Make Git Attribute appear in the language breakdown statistics 2023-12-27 13:17:21 -08:00
.gitignore Add F# and tweak C# (#128) 2021-03-10 19:41:29 +13:00
.pre-commit-config.yaml feat: check script and better maintainability 2023-08-19 19:09:23 +02:00
ActionScript.gitattributes Improved ActionScript gitattributes 2019-04-18 16:48:32 +12:00
Ada.gitattributes Update Ada.gitattributes: highlight *.gpr as Ada 2024-05-04 14:50:07 -07:00
C++.gitattributes added cpi source file to C++ gitattributes 2023-04-04 09:34:29 +02:00
check.sh perf(check.sh): Use POSIX parameter expansion instead of subshell 2023-12-10 18:49:46 -08:00
Common.gitattributes Add more compressed file extensions to Common.gitattributes 2024-03-22 03:13:35 -07:00
CSharp.gitattributes Do not use merge=union for C# projects, F# projects, and VS solutions 2022-07-07 21:39:09 +03:00
Delphi.gitattributes Added CRLF EOL for *.csv to conform with RFC 4180 2023-04-22 22:45:39 +03:00
Drupal.gitattributes Add JavaScript .cjs and .mjs extensions 2023-12-10 19:01:52 -08:00
DyalogAPL.gitattributes Create DyalogAPL.gitattributes 2024-06-19 21:22:56 -07:00
Elixir.gitattributes Update Elixir.gitattributes 2020-11-18 23:40:10 +13:00
Fortran.gitattributes feat: Support *.for 2019-07-17 15:21:18 +12:00
Go.gitattributes Add diff support for golang file 2019-03-09 15:22:19 +13:00
Java.gitattributes Add handling for windows .bat files 2025-01-21 13:43:56 +01:00
LICENSE docs(license): update copyright year(s) 2025-01-03 13:51:02 -08:00
Lua.gitattributes Merge branch 'master' into patch-7 2019-04-18 11:29:25 +12:00
Markdown.gitattributes Add Markdown in gitattributes 2022-09-23 10:05:12 -07:00
Mathematica.gitattributes Add Mathematica (#113) 2020-05-19 16:10:47 +12:00
Matlab.gitattributes Added Matlab diff 2019-03-09 15:33:13 +13:00
MicrosoftShell.gitattributes Microsoft Shell.gitattributes -> MicrosoftShell.gitattributes 2021-11-25 20:14:25 -08:00
ObjectiveC.gitattributes Format gitattributes files 2019-04-20 12:35:18 +12:00
Pascal.gitattributes feat: Support *.p 2019-07-17 15:23:10 +12:00
Perl.gitattributes Format gitattributes files 2019-04-20 12:35:18 +12:00
PHP.gitattributes feat: Add PHP template 2023-12-27 13:16:12 -08:00
PowerShell.gitattributes Create PowerShell.gitattributes 2021-11-20 15:48:50 +01:00
Python.gitattributes Jupyter notebooks are always created with LF (on Windows) 2022-12-07 21:09:26 +01:00
R.gitattributes Correct setting for .Rmd files 2021-11-20 16:17:17 +00:00
Rails.gitattributes Ruby diff 2019-04-19 19:00:18 +12:00
README.md Add gitattributes.com url to README 2023-12-10 19:02:46 -08:00
Rust.gitattributes Create Rust.gitattributes 2021-10-08 21:13:11 +02:00
Servoy.gitattributes fix(servoy): Typo in attribute key 2023-12-27 13:14:41 -08:00
Swift.gitattributes chore: Add top comment 2019-07-06 13:26:08 +12:00
TinaCMS.gitattributes Create TinaCMS.gitattributes 2023-07-16 21:41:06 -05:00
Unity.gitattributes Removes problematic wildcard from .blend files 2024-10-21 19:25:34 -07:00
Vim.gitattributes Added Vim (#119) 2020-10-15 10:46:15 +13:00
Web.gitattributes Add JavaScript .cjs and .mjs extensions 2023-12-10 19:01:52 -08:00

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