0

I keep on getting these pesky ^M caret symbols showing up with git diff. Note that the files are stored on Linux, but are edited via Windows using a Samba shared network. Trying to get rid of them, I performed the following per git-diff to ignore ^M:

[Michael@devserver .git]$ git config --global core.whitespace cr-at-eol

While the ^M are no longer displayed, what is worse is git diff still shows the line as being different, but the text is identical on both lines since the ^M is no longer displayed.

How can I reverse core.whitespace cr-at-eol? I thought I would be able to see the changes in git's config file, but not the case.

[Michael@devserver .git]$ cat config
[core]
        repositoryformatversion = 0
        filemode = true
        bare = false
        logallrefupdates = true
[remote "origin"]
        url = git@xxx.com:root/projextx.git
        fetch = +refs/heads/*:refs/remotes/origin/*
[branch "master"]
        remote = origin
        merge = refs/heads/master
Community
  • 1
  • 1
user1032531
  • 24,767
  • 68
  • 217
  • 387

1 Answers1

1

As you used --global, the setting is in ~/.gitconfig, not in <repository>/.git/config.
You can also see this using git config --show-origin -l.
If you would not have used --global, but --local (or nothing, as --local is the default) it would be in the file you are looking to.

Either remove it from that file, or better use git config like git config --global --unset core.whitespace.

Vampire
  • 35,631
  • 4
  • 76
  • 102