Skip to content

Instantly share code, notes, and snippets.

@jeanmonet
Forked from tekin/.gitattributes
Created October 24, 2020 13:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jeanmonet/70b28b413ddc30f18d9371231e9c4f43 to your computer and use it in GitHub Desktop.
Save jeanmonet/70b28b413ddc30f18d9371231e9c4f43 to your computer and use it in GitHub Desktop.
An example .gitattributes file that will configure custom hunk header patterns for some common languages and file formats. See https://tekin.co.uk/2020/10/better-git-diff-output-for-ruby-python-elixir-and-more for more details.
*.c diff=cpp
*.h diff=cpp
*.c++ diff=cpp
*.h++ diff=cpp
*.cpp diff=cpp
*.hpp diff=cpp
*.cc diff=cpp
*.hh diff=cpp
*.m diff=objc
*.mm diff=objc
*.cs diff=csharp
*.css diff=css
*.html diff=html
*.xhtml diff=html
*.ex diff=elixir
*.exs diff=elixir
*.go diff=golang
*.php diff=php
*.pl diff=perl
*.py diff=python
*.md diff=markdown
*.rb diff=ruby
*.rake diff=ruby
*.rs diff=rust
*.lisp diff=lisp
*.el diff=lisp
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment