Using Git in Windows Subsystem for Linux through IntelliJ

前端 未结 9 1006
萌比男神i
萌比男神i 2021-01-30 11:10

I\'m trying to set Git executable in IntelliJ to be the git installed in Windows Subsystem for Linux, I tried a few different ways, but always got some sort of error. Today I in

9条回答
  •  谎友^
    谎友^ (楼主)
    2021-01-30 11:24

    In PyCharm 2018.1 I got various errors, when trying to settled up Git. I've to combine different approaches to make it run. Next code works for me:

    @echo off
    setlocal enabledelayedexpansion
    set command=%*
    If %PROCESSOR_ARCHITECTURE% == x86 (
        echo | C:\Windows\sysnative\bash.exe -c 'git %command%'
    ) Else (
        echo | bash.exe -c 'git %command%'
    )
    

    UPD:

    Now is available integration with Git inside WSL through WSLGit wrapper. I've checket it out with PyCharm and it's work like a charm. Here is a link https://github.com/andy-5/wslgit

提交回复
热议问题