Can Git change files on checkout?
Does Git ever change files on checkout? I’m experiencing behavior where I check out a branch, and without touching anything I suddenly have six or eight changed files.
These files are marked as “not staged for commit” and they are not files that I had already edited on an existing branch.
I suspect it’s connected to a “line endings” setting discrepancy but I haven’t been able to isolate it. Here are all the Git settings (except for stuff like user.name and things like that):
core.symlinks=false core.autocrlf=true color.diff=auto color.status=auto color.branch=auto color.interactive=true pack.packsizelimit=2g help.format=html sendemail.smtpserver=/bin/msmtp.exe diff.astextplain.textconv=astextplain rebase.autosquash=true core.autocrlf=true core.excludesfile=C:\Users\username\Documents\gitignore_global.txt merge.renormalize=true core.repositoryformatversion=0 core.filemode=false core.bare=false core.logallrefupdates=true core.symlinks=false core.ignorecase=true core.hidedotfiles=dotGitOnly
Any help would be appreciated.
One Solution collect form web for “Can Git change files on checkout?”
git diff -b (diff ignoring whitespace changes). If the diff comes back empty then it’s probably all due to the line-ending conversions like you suspect.