git on windows shows modified files all the time, even for newly cloned repo
Check if the changes are merely changes in file permissions. This was the reason in my case, both TortoiseGit and Git Extensions displayed unmodified files.
Use git config core.fileMode false
to ignore chmod differences (or directly edit the .git/config file).
You may also want to set this as the global config with git config --global core.filemode false
.
None of the proposed fixes worked for me. However, I had Cygwin installed and TortoiseGit picked up its path when installed. I solved it by installing the official Git package and changed the path in TortoiseGit.
It's line endings issue. Set this on your windows machine:
git config --global core.autocrlf true
If using TortoiseGit with Cygwin git (not officially supported), several extra setup steps should be done:
Select the
[CYGWIN-INSTALL-PATH]\bin-folder
as git.exe folder.Configure the
HOME
environment variable in Windows, so that Cygwin and TortoiseGit are using the same home directory and global git-config. Use the normal Windows notation here (e.g.,C:\Users\USERNAME
). By default, TortoiseGit uses the Windows home directory which is normally located under c:\Users and Cygwin uses its own home directories which are located under[CYGWIN-INSTALL-PATH]\home
.Configure
AutoCrLf
, this is necessary as TortoiseGit and Cygwin Git have different defaults. The default in Cygwin Git istrue
.Go to TortoiseGit the section called
Advanced Settings
and setCygwinHack
totrue
in order to activate cygwin workarounds.Reboot.
Step #4 is crucial and resolved the problem for me.
Reference (see Cygwin Git section): https://tortoisegit.org/docs/tortoisegit/tgit-dug-settings.html