The code bases I work with are checked out from Git repositories onto my Linux machine. Since our production code is written to be deployed on Linux, I do all the testing on my Linux machine but like to use Windows for everyday usage, including code editing/authoring.
For that purpose, I have created a Samba share of the folder (my home folder) where I checkout the code to, like this:
[wgrover]
path = /home/wgrover
available = yes
valid users = wgrover
read only = no
browsable = yes
public = yes
writable = yes
However, when I edit a file from the samba share \\linux-box\wgrover
in Windows, the file permission in Linux keeps changing to 755
even though it was 644
before editing.
This keeps showing up in my git diff
like this:
diff --git a/debian/maggie.nginx.conf b/debian/maggie.nginx.conf
old mode 100644
new mode 100755
index 7cda506..7eab574
It is possible to set a create mask
in smb.conf but that will also not "preserve" the original file permissions. I can ignore file mode changes in git by setting fileMode = false
in .gitconfig
but that also ignores the problem.
Is there any way to preserve the file permissions when they are modified from linux?