问题很简单。Git 说我已将 CR ( ^M
) 添加到文件中,
me@myComp MINGW64 /c/workspace/service (develop)
$ git diff --check
engine/src/main/java/someFile.java:18: trailing whitespace.
+import some.java.package;^M
但我已经core.autocrlf
设置为true。
me@myComp MINGW64 /c/workspace/service (develop)
$ git config --get core.autocrlf
true
我以前没有遇到过这个问题,也不知道是什么原因造成的。我一直都core.autocrlf
设置为 true 并且在此之前从未抱怨过添加^M
。
这是git config --list
删除了一些个人信息、gui 设置和分支设置的输出,以防万一需要。
core.symlinks=false
core.autocrlf=true
core.fscache=true
color.diff=auto
color.status=auto
color.branch=auto
color.interactive=true
pack.packsizelimit=2g
help.format=html
http.sslcainfo=C:/Program Files/Git/mingw64/ssl/certs/ca-bundle.crt
sendemail.smtpserver=/bin/msmtp.exe
diff.astextplain.textconv=astextplain
rebase.autosquash=true
push.default=simple
core.autocrlf=true
core.pager=less -x4
core.trustctime=false
core.editor=vim
core.filemode=false
alias.hist=log --pretty=format:'%ad %C(yellow)%h%C(reset) %s %C(yellow)%an%C(reset)' --date=short
alias.logo=log --oneline
alias.superlog=log --decorate --graph
alias.superlogo=log --decorate --graph --oneline
alias.dry-merge=merge --no-commit --no-ff
gui.recentrepo=C:/sts-workspace/kba-service
merge.tool=vimdiff
merge.conflictstyle=diff3
mergetool.prompt=true
mergetool.keeptemporaries=false
mergetool.keepbackups=false
mergetool.trustexitcode=false
diff.tool=vimdiff
difftool.prompt=true
color.ui=true
credential.helper=cache --timeout=3600
core.repositoryformatversion=0
core.filemode=false
core.bare=false
core.logallrefupdates=true
core.symlinks=false
core.ignorecase=true
core.hidedotfiles=dotGitOnly
core.logallrefupdates=true
core.symlinks=false
core.ignorecase=true
core.hidedotfiles=dotGitOnly