1

When sharing a git repo between wsl on windows10 and any linux, all files added/changed from wsl get the rw-rw-rw attributes, even if I explicitly do a chmod ug+x file.py before adding. If You do a ls -l in wsl all files are listed with rwxrwxrwx no matter what.

On linux I have to do a find . -name "*.py" -exec chmod ug+x {} \; on every pull/clone

What is the best way to fix this? Are there some settings in WSL? git hooks?

MortenB
  • 2,749
  • 1
  • 31
  • 35

1 Answers1

2

I assume your git repo is somewhere in the windows file system, i.e. in /mnt/c/path/to/git. In this case WSL sets all permissions in order

to best reflect the Windows permissions. (FAQ)

There is currently no way in the stable build to change this behavior. But with the insider build 17063 the WSL team face this by implementing DrvFs support, which

allows setting the owner and mode of files using chmod/chown, and also the creation of special files such as fifos, unix sockets and device files. (Release Notes)

Dewey
  • 36
  • 3