How to handle file mode in linux and Windows shared repository?
I like TortoiseGit so much and cannot find a Linux equivalence. Therefore, when I'm working on Linux, I install virtual machine which runs Windows, TortoiseGit runs inside.
My Git repositories are shared among the host machine and the virtual machine. I use TortoiseGit in the virtual machine to manipulate these repositories.
Some repositories have Linux executable files with
x bit in file mode, and the repository setting has core.filemode = true in .git/config. If I edit the file and commit it with TortoiseGit, because of core.filemode = true, TortoiseGit changes the file mode, and makes the file not runable on Linux.
What steps will reproduce the problem?
- On Linux, make a executable and give it x bit.
- Edit the file.
- Commit the file on Windows TortoiseGit.
What is the expected output? What do you see instead?
I see TortoiseGit changes filemode. It's understandable as Windows doesn't have the x bit, and core.filemode is true in .git/config. However the behavior is not desired.
What is the best way to handle this situation? I tried to put
[core] filemode = true
in .tgitconfig, which seems the TortoiseGit specific settings file. The setting doesn't seem to be picked up.
Is there a way to force overwrite repository config? Can TortoiseGit allow users to provide custom config for commands, for instance
git -c <user config> commit ...
What version of TortoiseGit and Git are you using? On what operating system?
git version 2.21.0.windows.1