Files showing as modified directly after a Git clone
git config core.fileMode false
solved this problem in my case
https://git-scm.com/docs/git-config
TL;DR;
core.fileMode
If false, the executable bit differences between the index and the working tree are ignored; useful on broken filesystems like FAT. See git-update-index(1).
The default is true, except git-clone(1) or git-init(1) will probe and set core.fileMode false if appropriate when the repository is created.
I got it. All the other developers are on Ubuntu (I think) and thus have case-sensitive file systems. I, however, do not (as I'm on a Mac). Indeed, all the files had lowercase twins when I took a look at them using git ls-tree HEAD <path>
.
I'll get one of them to sort it out.
I had the same problem on the Mac after cloning a repository. It would assume all files had been changed.
After running git config --global core.autocrlf input
, it was still marking all files as changed. After looking for a fix I came across .gitattributes
file in the home directory which had the following.
* text=auto
I commented it out and any other cloned repositories from now on were working fine.