Skip to content

Instantly share code, notes, and snippets.

@doitian
Created June 21, 2024 01:51
Show Gist options
  • Save doitian/3e007b3089114080ce614d6df7020f68 to your computer and use it in GitHub Desktop.
Save doitian/3e007b3089114080ce614d6df7020f68 to your computer and use it in GitHub Desktop.
git shim for WSL
#!/bin/bash
# Check if the current directory starts with /mnt/
if pwd -P | grep -q "^/mnt/"; then
# Use git.exe for directories under /mnt/
exec git.exe "$@"
else
# Use /usr/bin/git for other directories
exec /usr/bin/git "$@"
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment