- Copy gitkraken-wsl-bash.bat and gitkraken-wsl-bash.sh, I put them in ~/bin.
- Make sure that the script path in the bat-file and MOUNT_ROOT in the sh-file are correct.
- Set
gitkraken-wsl-bash.bat
as 'Path to sh.exe' in GitKraken.
-
-
Save carlolars/ed976078a66e7d57bb04f959270bdee3 to your computer and use it in GitHub Desktop.
@echo off | |
REM Make sure that the path to the script is correct! | |
@bash -l -c "~/bin/gitkraken-wsl-bash.sh %*" |
#!/bin/bash | |
# Mount root for windows drives, default is /mnt/ but can be changed in /etc/wsl.conf | |
MOUNT_ROOT=/mnt/ | |
# Read GitKraken's hook script and arguments from STDIN | |
read -r GITKRAKEN_CMD | |
# Cleanup the path to the script: | |
# - Replace two or more '\' in a row with a single '/'. | |
# - Replace the windows drive letter (C:) with the mount point for the drive (/mnt/c) | |
FIXED_CMD=$(echo $GITKRAKEN_CMD | sed 's_\\\{2,\}_/_g' | sed "s_\([A-Z]\)\:/_$MOUNT_ROOT\L\1/_g") | |
# Run the hook script | |
bash -c "$FIXED_CMD" |
Wow! Thanks for the tip and your work on the wslgit pull request! This is a major pain killer for me.
PS: the updated version of wslgit also works with GitKraken.
@Ridder90 how did you make wslgit work with GitKraken?
If someone found out how to make wslgit work with GitKraken, please let me know.
This does not work for new versions of gitkraken.
In windows 11 you can just run the Linux version.
https://github.com/microsoft/wslg
On windows 10 I used this
https://opticos.github.io/gwsl/
It actually works fine for me on Windows 11 with latest GitKraken.
I've tried a lot of xservers previously and also tried wslg. It looks promising but still has too many issues. I am going with this workaround for now.
@DAmNRelentless how did you get this to work with later versions of gitkraken?
I thought they used an internal git implementation instead of external commands?
I put both files into the same directory, adjusted the path in the gitkraken-wsl-bash.bat
and set my GitKraken path for the sh.exe
to this batch file.
Hi @Ridder90, I've been using Fork for some time now. It was a lot faster than kraken back when I switched and it's possible to have it use the git-client from within WSL by using wslgit (currently full support only in the develop branch). They recently started charging $50 for a lifetime license but imo it was definitely worth it.