I modified my .gitconfig in such a way that I have some colors when performing git diff:
$ cat .gitconfig
[color]
ui = true
I’m working on an ubuntu machine and I edited some code using VIM. After editing a file a execute git diff, once with and once without ui=true.
Problem: in the first case I have ^M characters and the end of the edited lines. However, I don’t see those when turning of color.ui or when looking with vim, cat, more.. at the manipulated file.
It is probably an encoding issue. The ‘git diff’ command is executing Vim thinking that the file format is Dos.
When you are using any other command, it is correctly recognized as a Unix file.
Can you try :
:set fileformat=unixin your git diff window ?
I am not really sure this is the root cause, because I don’t see the link with the
uioption.