I am using Tortoise via samba share on a folder where I develop on a Linux VM by using Visual Studio Code Remote SSH.
I normalized all files to NL on the Linux VM and added a .gitattributes file with:
* text=auto
*.c text eol=lf
*.h text eol=lf
I committed and pushed all the changed files with the git command line on the VM, and my git status on the Linux VM is empty.
Now on my Windows PC when trying to commit with Tortoise I get a bunch of modified files, which have no modifications.
I tried fiddling with the local AutoCrLf
in Tortoise Git settings, but the files still show up.
That basically changes .git/config
setting autocrlf
from false to true and viceversa.
But neither setting makes the files disappear from Tortoise Git when comitting. The files simply cannot be changed because they are the same files, just acessing them from a share on a Windows PC to use and comitting them with Tortoise.
Of course committing files without changes breaks the repo. I tried deleting the files and using git checkout to get them back but the same happens.
How can I make Tortoise work like git status?
EDIT:
I tried git status
on windows and unlike on Linux it shows the files as modified as well.
Can it be a difference between git for windows and git for linux?
I found out it was not a problem with Tortoise but rather a problem with Git for windows.
The setting to toggle to false was in the local git config:
[core]
filemode = false
This is because file permissions/user/group modified on linux are handled correctly, but on the samba share the windows Git sees that something has changed because of the samba ACL, but it does not know what.