You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In WSL 2, when a Git repository is hosted within the Linux file system and contains executable files, these files are seen by Windows Git as non-executable.
Get the Windows path to this folder. This can be done by typing explorer.exe . in bash and getting the full path from the Windows Explorer window that opens. e.g: \\wsl$\Ubuntu\home\<user>\wsl2-executable-files
In Windows PowerShell run the following commands:
cd \\wsl$\Ubuntu\home\<user>\wsl2-executable-files
git status
Expected Result
The Windows version of Git should not detect any changes to the repository hosted in the Linux file system
PS Microsoft.PowerShell.Core\FileSystem::\\wsl$\Ubuntu\home\<user>\wsl2-executable-files> git status
On branch master
nothing to commit, working tree clean
Actual Result (problem)
The Windows version of Git shows that test-executable has been modified:
PS Microsoft.PowerShell.Core\FileSystem::\\wsl$\Ubuntu\home\<user>\wsl2-executable-files> git status
On branch master
Changes not staged for commit:
(use "git add <file>..." to update what will be committed)
(use "git checkout -- <file>..." to discard changes in working directory)
modified: test-executable
PS Microsoft.PowerShell.Core\FileSystem::\\wsl$\Ubuntu\home\<user>\wsl2-executable-files> git diff
diff --git a/test-executable b/test-executable
old mode 100755
new mode 100644
This also manifests in editors like Atom that have built-in support for Git. If a Windows version of Atom is opened to read the repository hosted in the Linux file system, it will also detect a change:
System Information
Windows Build Number
Microsoft Windows [Version 10.0.18941.1001]`
WSL Instance Information
C:\> wsl --list --verbose
NAME STATE VERSION
* Ubuntu Running 2
Ubuntu information
$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 18.04.2 LTS
Release: 18.04
Codename: bionic
Linux Git Version
$ git --version
git version 2.17.1
Windows Git Version
PS C:\> git --version
git version 2.22.0.windows.1
The text was updated successfully, but these errors were encountered:
This is by-design Windows git.exe which does not grok Linux metadata. You'd see the same behavior if you did the same thing on a Real Linux box and Windows given identical circumstances. There are standard work-arounds for the impedance mismatch. Hail Mary ref #3865 maybe one day in a galaxy far far way.
Description
In WSL 2, when a Git repository is hosted within the Linux file system and contains executable files, these files are seen by Windows Git as non-executable.
Steps to reproduce
Get the Windows path to this folder. This can be done by typing
explorer.exe .
inbash
and getting the full path from the Windows Explorer window that opens. e.g:\\wsl$\Ubuntu\home\<user>\wsl2-executable-files
In Windows PowerShell run the following commands:
Expected Result
The Windows version of Git should not detect any changes to the repository hosted in the Linux file system
Actual Result (problem)
The Windows version of Git shows that
test-executable
has been modified:This also manifests in editors like Atom that have built-in support for Git. If a Windows version of Atom is opened to read the repository hosted in the Linux file system, it will also detect a change:
System Information
Windows Build Number
WSL Instance Information
Ubuntu information
Linux Git Version
Windows Git Version
The text was updated successfully, but these errors were encountered: