Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I like the Git Shell because it allows me to run popular linux commands in my windows environment. My IDE allows me to run command-line programs inside an embedded console, which I also quite like. I was hoping I could use the Git Shell from inside this console, but when I run the command as specified in the shortcut icon it created,

C:\Users\Mark\AppData\Local\GitHub\GitHub.appref-ms --open-shell

It just opens a new command prompt rather than using the current one. Is there a way to force it to use the current prompt?

share|improve this question
up vote 1 down vote accepted

To run the git shell in current command prompt you execute

"C:\Program Files (x86)\Git\bin\sh.exe" --login

To execute a command in git shell and have it return output, you do

"C:\Program Files (x86)\Git\bin\sh.exe" --login -c <your command>

I have it also set up with Sublime Text's plugin Shell Turtlestein
actual setting: {"surround_cmd": ["\"C:\\Program Files (x86)\\Git\\bin\\sh.exe\" --login -c ' ", " ' "]}
and it works flawlessly

See if you can plug that command like that in your IDE to make it work

share|improve this answer
Weird. When I opened my settings today it had this in it: C:\Windows\SysWOW64\cmd.exe /c ""C:\Program Files (x86)\Git\bin\sh.exe" --login -i" so either I figured it out (and forgot), or something installed it for me. Not sure what the difference between your command and mine is, but both seem to work. – mpen Sep 18 '14 at 6:12

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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