I have a markdown file with lines that have trailing whitespace (which is correct and should be commited). I'm unable to add these changes using git add -p
to the index because git complains about trailing whitespace. They are added correctly if I use git add -A
, but I want it to work with git add -p
.
I have in my ~/.gitconfig
:
[core]
whitespace = trailing-space,space-before-tab
This has been working fine since for the most part I DO want to warn on trailing whitespace (it is incorrect in HTML, JS and Ruby files).
How do I ignore the trailing whitespace in Markdown files only?