Using Git in Windows Subsystem for Linux through IntelliJ

I was looking for a way to use git on WSL Windows Subsystem for Linux through Webstorm or an IntelliJ idea software.

I tried KatoPue’s solution, but I got the following error:

fatal: could not read log file 'C:/Program Files/Git/mnt/c/Users/Elies/AppData/Local/Temp/git-commit-msg-.txt': No such file or directory

I solved it by replacing the path when sending the command to WSL’s git

Settings > Version Control > Git > Path to Git executable : path_to_wslgit.bat

wslgit.bat :

@echo off
setlocal enabledelayedexpansion
set command=%*
set find=C:\Users\%USERNAME%\AppData\Local\Temp\git-commit-msg-.txt
set replace=/mnt/c/Users/%USERNAME%/AppData/Local/Temp/git-commit-msg-.txt
call set command=%%command:!find!=!replace!%%
echo | C:\Windows\Sysnative\bash.exe -c 'git %command%'

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)