So, I happened to use Git on a repo cloned to Windows filesystem, but with WSL2 shell, and sent git commands via WSL2 zsh.
That is, in settings.json
.
{
"terminal.integrated.shell.windows": "C:\\windows\\System32\\wsl.exe"
}
Git is installed on both Windows and WSL2.
It appears that file mode when created with Git on Windows is 644
, but on WSL2 Ubuntu, it is 755
. I found this out when switching branches with VSCode (outside Remote WSL2 plugin).
Quick fixes
- Current repos
sed 's/filemode = true/filemode = false/' .git/config
- Globally. Run this on both WSL2 shell and PowerShell.
git config --global core.fileMode false
Additional notes
I don't know how you keep up with Git on Windows. So many choices to be made on set up. I did none of these on macOS or Linux.
Top comments (1)
maybe you can refer to this.
====
from git-config