1
0
mirror of https://github.com/gitattributes/gitattributes.git synced 2025-01-22 00:08:52 -05:00
Go to file
2023-12-10 19:01:52 -08:00
.github Bump actions/checkout from 3 to 4 2023-09-17 21:55:05 -07:00
community Add JavaScript .cjs and .mjs extensions 2023-12-10 19:01:52 -08:00
Global Create community and Global folders 2023-07-17 14:44:14 -05:00
.gitattributes Add CRLF EOL for Window-specific file formats and add diffs (#129) 2021-03-23 18:02:16 +13: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 feat: Support *.adb and *.ads 2019-07-17 15:25:27 +12: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 Added CRLF EOL for *.csv to conform with RFC 4180 2023-04-22 22:45:39 +03: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
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 JavaScript .cjs and .mjs extensions 2023-12-10 19:01:52 -08:00
LICENSE feat: check script and better maintainability 2023-08-19 19:09:23 +02: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
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 Re-apply 2023-08-25 15:36:18 -07:00
Rust.gitattributes Create Rust.gitattributes 2021-10-08 21:13:11 +02:00
Servoy.gitattributes Add JavaScript .cjs and .mjs extensions 2023-12-10 19:01:52 -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 Add back eol=lf to YAML files 2023-07-31 22:52:21 +03: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 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