0

I work with git in WSL2 (Ubuntu) on Windows and with a bitbucket hosted repo (it's on the Internet) and normally everything works fine.

But the moment I connect my Windows machine to the company private VPN, the git pull stops working (it just hangs endlessly).

I want WSL2 traffic to be directed to the VPN. Except for git.

How can I tell git in WSL2, and only git, to continue using the main network and not the VPN?

4
  • 2
    It might be something to tell to Windows ("split tunneling") rather than its guest which can only do what its hypervisor (Windows) provides.
    – A.B
    Aug 23, 2023 at 13:17
  • 1
    This depends of the VPN tool you're using, @job-1 Internet connections where direct through main network while current VPN/IPSec is handling everything even the GeoIP.
    – admstg
    Aug 23, 2023 at 13:18
  • Sorry, I need to elaborate. I do want the WSL traffic to go to the VPN. Except for git. Is there a way to tell just git in WSL to be routed differently to the host (windows) main network?
    – Eden
    Aug 27, 2023 at 8:57
  • You must understand that it's not caused by WSL or git. It's caused by Windows's routing, and the fix has thus to happen on Windows. You asked the wrong StackExchange for this: here it's about Unix/Linux and not about Windows.
    – A.B
    Aug 27, 2023 at 9:12

1 Answer 1

2

It is not the job of an app that uses TCP (or UDP), to route itself. You need to set up a route, using the host OS.

2
  • Since it is only git that needs to be diverted, I thought maybe some git configuration or proxy?
    – Eden
    Aug 27, 2023 at 9:01
  • You can setup a route to one IP address. But this is all done in the network sub-system (part of the OS). Aug 27, 2023 at 20:47

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .