Running .exe file in Git Bash

3.1k views Asked by At

I want Git bash to execute a .exe file just by writing git filename.exe. Indeed, I've got the cloc.exe file (which counts code lines) and I want to run it from Git Bash instead of from Windows CMD.

1

There are 1 answers

0
VonC On

For that, your executable needs to be:

  • on the $PATH (which can be defined in ~/.bashrc)
  • named git-cloc.exe

Then you would be able to type, in a git bash session (or even in a CMD, if part of the %PATH%):

git cloc

The idea is: any executable name git-xxx allows you to type git xxx (as long as it is found in the $PATH)