Git for Windows installs "Git Bash," a bash shell that works in Windows, which is very nice. It's based on MinTTY, I believe.

As well as bash shell scripts, it can also execute Windows batch (.bat) files, e.g.

$ ./some-batch-file.bat

executes without any issue.

But tab-completion doesn't work on these batch files. Typing ./some-TAB has no effect.

Is there some way to enable tab-completion for .bat files in Git bash?

| improve this question | | | | |

I can at least provide a workaround for those interested. I start with typing vi or ls followed by ./ and from there tab completion works then I just move the cursor to the start of the line with Home and press Delete three times.

I wish I could just add .bat to an environment variable that holds a list for tab completion but I'm not sure there is one?

| improve this answer | | | | |

I've manged to get this working, I found a post about getting .sh files to work in Git Bash using this on the first line of the file:


This also works when placed on the first line of .bat files. You still have to start with the ./ before the file name.

| improve this answer | | | | |
  • 1
    This isn’t going to work for me (looking to use batch files from a repo, neither want to commit such changes nor maintain my own set of changes across pulls), but good to know. – KRyan Oct 29 '19 at 20:16

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.