-
Notifications
You must be signed in to change notification settings - Fork 9.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
GitHub Desktop gets confused on file permissions (x-bit) in WSL #9443
Comments
This comment has been minimized.
This comment has been minimized.
@bert-laverman thanks for filing this issue! I'm sorry you're experiencing this. Since this involves WSL (effectively running Linux on a Windows system) and we don't support Linux I'm not sure where this falls on our support commitment. @desktop/product could you provide some guidance here? @bert-laverman have you been found any workarounds that are helpful? I'm imagining moving the repo to a non-WSL folder might be one? Could you also help clarify what you mean by a "WSL share"? |
@outofambit This was a learning trajectory for me too. I found out that the " That said, if you could actually use the " I just tested, and the following worked:
Or, more appropriately:
|
Suggestion: make the "git" command a configurable option, so we can use the above instead of "standard Windows git"? My knowledge of JavaScript/TypeScript for desktop apps is definitely not enough to suggest a PR. |
Hey, so what I've noticed is that WSL2 has a notoriously slower I/O with Windows filesystem which they openly admit. So GitHub Desktop should support SSH into WSL instead of trying to access the filesystem. We're experiencing false changes, which the diffs show nothing. So the permissions are causing false changes, and when trying to commit Desktop just errors out. I stated SSH as VS Code remotes into WSL, but using the wsl prefix should work just as well |
This is what I did to solve this.
After this, I no longer see changes caused by filemode changes done in WSL at GitHub Desktop. Note the "false" changes are also reported when running a simple |
@Adrianilloo I couldn't get the suggestion above to work with WSL2 no matter which combination I tried |
@Anthropic Not that I can think of. To reproduce the issue (or test my solution), you need to ensure that you have a file committed with executable bit (double check with with an Also, I did some tests to check how my suggested setup can affect loosing the executable bit upon a However, I've run the same I hope this extra information comes useful for anyone. |
@Adrianilloo I got it to work, it just needed a full system re-start before trying commands a second time, then it worked. ps. I did restart in prior attempts, but then after shutting down, it just worked the next time I started my laptop and tried again. |
While manually disabling filemode on Windows git can get around this issue, the better fix for GitHub Desktop is probably to detect that the target dir is within the WSL filesystem and use WSL git (along the lines of what @bert-laverman suggested above, but automatic). Basically, it should operate like "WSL Remote" mode in VS Code: The logic to detect that the target dir is in the WSL filesystem is the same as what would be required for the related feature request #9721. |
So, is there any documentation / workable solution on using GitHub Desktop to push and pull files that are in WSL2? I am on Windows 10 Pro build 19043.1110, With Ubuntu 20.04. It would be really nice to be able to add a repository from WSL2 to GitHub Desktop. |
Yeah, this sucks. Just tried GitHub desktop again coz I miss it and haven't been able to use it since I moved to WSlv2. And it's actually a lot worse now. FYI what people say about WSL2 having slow IO with windows file system while true is irrelevant. If we could just tell GitHub to use the git binary inside WSL not only will all the problems go away but the IO performance will probably be much faster than windows git on NTFS as IO performance in WSL2 is actually super fast. It is just obviously slow if your accessing pseudo network mounts to a windows files system from within a pseudo-Linux VM. Until this issue is resolved guess I have to forget Github desktop again to go back to using git cola. 😢 PS - To others looking for workaround: |
BRO U FANTASTIC |
It works like a charm ✨ |
It Worked... Thanks man |
Any chance this can be included somewhere in GitHub Desktop docs or in the app itself? The fix mentioned here works perfectly but had to dig around to find it |
Sorry, I haven't visited this issue for a while. I see above that you can solve the issue by playing ostrich and simply disabling file mode bits in Windows-git. Is that really what we want as a solution? I work in an environment where repositories will be used on Linux, Windows, and macOS, and disabling file mode bits would invite the dreaded "works on my machine" response to issues with them. Is it so hard to expose the actual call to the git command-line utility and make it configurable? Or does GitHub Desktop use its own implementation in JavaScript? Again: the command-line utility sometimes does it correctly, and being able to use " |
That's actually a really good point... While this fix works for me in this situation, it would not work within many projects, as you say |
For folks who are totally new to this, I found three ways to update the Windows config:
OR Use a text editor to open OR In GitHub Desktop go to File > Options > Git > edit your global Git config file. For those last two methods, this would be appended manually to the config:
As explained earlier in this thread, it was also necessary to set |
Describe the bug
GitHub Desktop mistakenly marks files which have the x-bit set (mode 0755 on MacOS and Linux) as changed when the checked out repo is on a WSL "share".
Version & OS
GitHub Desktop 2.4.0, Windows 10 Pro, WSL 2 (Windows preview "slow" channel)
Steps to reproduce the behavior
/mnt/c/Users/xyz
".git clone
" of any repository containing executable scripts, such as shell scripts or Python programs.git ls-files -s
" to verify.\\wsl$\home\<user>
".git status
" on the WSL commandline will show that actually nothing has changed.Expected behavior
GitHub Desktop should show that nothing has actually changed.
Actual behavior
GitHub Desktop shows files as changed and wants them to be checked in.
The text was updated successfully, but these errors were encountered: