Skip to content

Instantly share code, notes, and snippets.

@sryze
Last active November 11, 2023 09:33
Show Gist options
  • Save sryze/acc572d01b02d6280ffd438469b6605d to your computer and use it in GitHub Desktop.
Save sryze/acc572d01b02d6280ffd438469b6605d to your computer and use it in GitHub Desktop.
Quickly run a shell command inside Git Bash from command prompt / PowerShell on Windows (without manually opening a new Git Bash instance)
@echo off
REM Usage: bashdo echo 'hello, world!'
REM Caution: it doesn't work well if there are double quotes in your Bash commands (need to figure out how to escape them).
"%ProgramFiles%\Git\bin\bash.exe" -l -c "%*"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment