Skip to content

Still unable to discard changes on Windows using WSL #14244

Open

Description

@j0nm1

Search existing issues

  • I have searched the issue tracker and confirmed that I was unable to find existing issues for the problem I am experiencing.

The problem

I have cloned a repository on a Windows 11 WSL2 drive (\wsl.localhost\Ubuntu\home...). Then I have created a new file by mistake and I want to discard it. Github Desktop is not able to discard the newly added file (but I can discard changes in files that are already tracked).

When I click the discard changes button, I get the error message that it "Failed to discard changes to Recycle Bin." (which is expected). But after clicking on "Permanently discard changes" it still does not delete the file. After a short loading period, the modal closes itself but the file is still there.

There are no errors in the logs and this is not a permission problem (as I can delete those files manually without any problems)

Release version

2.9.12

Operating system

Windows 11

Steps to reproduce the behavior

  1. Clone a repository to a WSL path
  2. Create a new file in the repository
  3. Try to discard the newly created file with Github Desktop
  4. The file is still there

Log files

2022-03-28T12:27:12.451Z - info: [ui] [AppStore] loading 5 repositories from store
2022-03-28T12:27:12.453Z - info: [ui] [AppStore] found account: j0nm1 (Jonas Michaelis)
2022-03-28T12:27:12.464Z - info: [ui] [BranchPruner] Last prune took place in 1 hour - skipping
2022-03-28T12:27:12.980Z - info: [ui] launching: 2.9.12 (Windows 10.0.22000)
2022-03-28T12:27:12.982Z - info: [ui] execPath: 'C:\Users\Jonas\AppData\Local\GitHubDesktop\app-2.9.12\GitHubDesktop.exe'
2022-03-28T12:27:12.989Z - info: [ui] Subscribed 'j0nm1' to Alive channel
2022-03-28T12:27:18.240Z - info: [ui] No submodules found. Skipping "git submodule status"
2022-03-28T12:27:19.160Z - info: [ui] No submodules found. Skipping "git submodule status"

Screenshots

No response

Additional context

No response

Activity

  1. sergiou87 commented on Mar 28, 2022

    @sergiou87
    Member

    Thanks for your report @j0nm1!

    Did this ever work in previous versions of GitHub Desktop? (namely on 2.9.6 and older)

  2. added
    more-info-needed
    on Mar 28, 2022
  3. j0nm1 commented on Mar 28, 2022

    @j0nm1
    Author

    I just downloaded Version 2.9.6 to try it out. It's exactly the same (but without the confirmation modal), newly created files cannot be discarded. There is no error, the file just doesn't get deleted. Nothing in the logs.

  4. removed
    more-info-needed
    on Mar 28, 2022
  5. added
    bug
    priority-3
    on Mar 28, 2022
  6. steveward commented on Mar 29, 2022

    @steveward
    Contributor

    I was able to reproduce this as well. Discarding changes in a mapped network drive works without issue.

  7. added
    windows
    on Apr 17, 2022
  8. Squadz commented on Apr 23, 2022

    @Squadz

    Same, I'm unable to discard for any files located in WSL (Win11)

    I have a similar behavior when I try to ignore a file (add to .gitignore) in WSL.

    Github Desktop v2.9.16-beta1

  9. zedd3v commented on Apr 29, 2022

    @zedd3v

    Same behavior here

    Running windows 11 with wsl2

    Github Desktop 2.9.16-beta2

  10. dev-cadet commented on Jul 27, 2023

    @dev-cadet

    I am also experiencing this issue. GitHub Desktop version 3.2.6

    If this helps, using dev tools you can see the following console log from install.ts

    • No submodules found. Skipping "git submodule status"

    So this looks like a git issue instead?

    ** EDIT **
    I just successfully discarded it while I had the project open in VS Code via WSL. I hope this finds usefull for whoever is investigating :)

  11. ms-afk commented on Oct 22, 2023

    @ms-afk

    Could this be the reason?

  12. steveward commented on Oct 23, 2023

    @steveward
    Contributor

    @ms-afk thanks for sharing that, I'll make a note to look into that this week!

  13. NibrasAbuAyyash commented on Nov 9, 2024

    @NibrasAbuAyyash

    Hi,
    The problem still occurs with the latest version of GitHub Desktop, Ubuntu 24.04, and WSL 2 with Docker Desktop.

    Is there a solution to the problem? Every time I need to delete it from VS Code or File Manager.

  14. C0rn3j commented on Nov 19, 2024

    @C0rn3j

    Yes, the solution seems to be to pull #16378, which itself needs desktop/dugite#532.

    I see @niik working on a 3.0.0rcs of Dugite, any chance the PR can make it in there for 3.0.0, to get this rolling?

  15. aleixrodriala commented on Mar 26, 2026

    @aleixrodriala

    I've been struggling with this for a while and ended up building a fork that fixes it: GithubDesktopWSL

    Think of it like the VS Code Remote WSL extension but for GitHub Desktop. It runs a small daemon inside WSL that handles git and file operations natively over TCP instead of going through 9P.

    Operation Fork Official Speedup
    git status 2 ms 43 ms 20x
    git log 2 ms 41 ms 24x
    Open repo 16 ms 173 ms 11x

    I went with a patch-based approach so it auto-syncs with upstream releases. You can just download the installer and try it, installs side-by-side with official Desktop.

    Would love if anyone here could give it a try and let me know how it goes!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugpriority-3windows

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions