I have the following .gitattributes file in my project
*.txt -diff
This works as expected, it ignores .txt files when I do a git diff. However when I change this to
*.txt diff=test
and add
[diff "test"]
colorMoved = plain
to my .git/config file, it does not work. The colors of git diff do not change.
If I add
[diff]
colorMoved = plain
It does changes the color in git diff. So my conclusion is that the .gitattributes file is being used and the .git/config is working as well. However the combination does not work. Any ideas what I am doing wrong?
I am using git version 2.33.0.windows.2
Setting the diff algorithm works for attributes but not for colors or anything else.
git help config shows that the config key is diff.colorMoved but there is no diff.<name>.colorMoved.
Ability to set the diff algorithm per attribute was added somewhere between Git 2.36 and 2.42. Compare the docs for 2.36 and 2.42.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With