Is it possible to do a case insensitive git diff
while also doing git diff --color-words
? Or do I need to use an external diff program while doing git diff --color-words
?
( note: if all you want is git diff case insensitive please go to this question How to perform case insensitive diff in Git )
git diff --color-words git diff also has a special mode for highlighting changes with much better granularity: ‐‐color-words . This mode tokenizes added and removed lines by whitespace and then diffs those. Now the output displays only the color-coded words that have changed.
^M represents carriage return. This diff means something removed a Unicode BOM from the beginning of the line and added a CR at the end.
Now, It is showing changes to be committed which means the file is now included and ready to commit. We can commit files using the git commit -m “message” command. Output: After committing, the status is now changed to nothing to commit because now the working tree is clean.
GIT_EXTERNAL_DIFF='diff -ipu "$2" "$5" #' git diff --ext-diff
Or, in a nicer fashion without the # hack I used there:
echo 'diff -ipu "$2" "$5"' >myscript; chmod a+x myscript;
GIT_EXTERNAL_DIFF='./myscript' git diff --ext-diff
I agree it would be nicest if git-diff would just have an -i
option...
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