Search code examples
gitgit-diff

git display different techniques to see hidden characters


I have executed git diff.UserlogList .js, but git is showing that I've deleted line and added a new one, the line that I have added is the same, how I can see invisible chars? Or there is another logic in git that I don't understand?

Screenshot


Solution

  • Try the --color-words option to git diff. More info at man git-diff.

    There are also config options to control the colouring of the diff output, useful for spotting small differences such as whitespace changes. See man git-config, look for color.diff.<slot>.