Skip to content

[Feature] Support for WSL git #1357

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

Draft
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

roguesaloon
Copy link

@roguesaloon roguesaloon commented May 23, 2025

Allows for sourcegit to use WSL git (from default distribution) when working inside a WSL directory with UNC path (i.e. \\wsl.localhost) on Windows. Dynamically chooses to use WSL git over windows git based on the filepath.

This allows users to manage WSL repos through the same windows instance of sourcegit alongside windows repos, which is a huge win for my own personal workflow. Partly based on similar WSL implementation in GitExtensions.

@roguesaloon roguesaloon changed the title Support for WSL git [Feature] Support for WSL git May 23, 2025
@love-linger
Copy link
Collaborator

I don't recommend doing this. The reasons are:

  • SourceGit supports to run on Linux platform. Users can run it in WSL distro directly.
  • Users can also store their local repo in Windows side, and use paths like /mnt/<driver>/<path_to_repo> to access this repo in WSL distro side.
  • In this PR:
    • The file system monitoring feature may not work properly. This means that users may need to manually refresh to see the latest state of the repository.
    • Open in Terminal may not work properly.

@roguesaloon
Copy link
Author

roguesaloon commented May 27, 2025

@love-linger Thanks for the feedback, you are also right on the functionality front. The terminal should be an easy fix but I'll likely need to find some more time to investigate a proper solution for the File Watcher (which I had completely missed wasn't working), so I'll put this into draft for now, until I can get back to it.

As for the motivation for supporting this:

  • If we run SourceGit in WSL directly we need to effectively run it twice in two separate instances (on windows and linux). I personally have a handful of repos under windows and a handful under WSL, so this is annoying at best. Managing lots of repositories quickly in a centralized place is one of the main pros of using a GUI for git IMO.
  • Storing files in /mnt/c/dev (which could be managed natively with windows git) for WSL isn't very practical due to major IO bottlnecks between the two. I have tried this and it effectively results in files being almost unusable for development (at least in WSL2, WSL1 does support this a bit better).
  • Other git GUIs like Kraken, Tower, and GitExtensions already support using WSL in this way, so it seems like a sensible idea.

@roguesaloon roguesaloon marked this pull request as draft May 27, 2025 22:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants