7

Is it possible to install git on windows without also installing git bash?

Now that bash is available on windows I'd prefer to use that and not have so many shells lying around.

Is that even a recommended/possible approach? Or should I just install git bash anyway?

| |
  • Well my question was more, how do I install git on windows itself (not in ubuntu) without the bash shell? Or is it more advisable to install git directly through ubuntu instead of windows? – Simon Aug 12 '16 at 17:54
  • yes, the issue is that if I have some windows application that hooks into git, I cant tell it to go use the one installed on ubuntu. I need some version of git installed on the windows side as well. But given that I dont want to use git bash, I want some way to install git on windows without bash... – Simon Aug 12 '16 at 22:11
  • So I have sourcetree installed on Windows. Without git installed on windows, how would I tell sourcetree to go use the one installed on ubuntu? – Simon Aug 12 '16 at 22:36
  • Well, I think you misunderstood the question (either that or I included unnecessary information regarding linux which confused things). Either way, its simply this: I want to install git on Windows 10. The default git installer also installs git bash. I dont want git bash. Can I get rid of it or prevent it from installing? – Simon Aug 12 '16 at 23:05
  • Dont think I ever said that anywhere. If anything I specifically said the complete opposite in my first comment... – Simon Aug 13 '16 at 3:15
2

The Windows Git installer does have some configuration options; though, I do not remember if the bash shell is one of the optional parts. That said, there is no reason why you have to use the bash shell for git. You can run git commands from cmd as well as PowerShell.

There is a nice add-in component for enhancing PowerShell with git integration. I do all of my git interaction from PowerShell. I have never opened up the bash shell, assuming that it was even installed with git.

| |
  • Yeah I took a look at the installer options again just now and it doesnt seem like theres an option to not install it. But maybe someone knows of a way to remove it post install... – Simon Aug 12 '16 at 23:06
  • 1
    @simon you should be able to delete the bash executable with no ill effect, if you really do not want to have it there. I would recommend first just moving it out to verify that there are no ill effects. – Eric Johnson Aug 12 '16 at 23:11
  • I want to remove it because I have actual bash installed through WSL. Git Bash keeps coming up before actual bash -- despite being less frequently used and after it in alphabetical order -- so I want it gone. "Just use another shell" isn't an answer in my case. Have you tested if deleting the executable breaks things? – Fund Monica's Lawsuit Mar 20 '19 at 0:51
  • Actually I figured my issue out -- when installing, there's an option to not create a Start Menu folder, which makes it not show up in the Start Menu, as I wanted. – Fund Monica's Lawsuit Mar 20 '19 at 0:58
1

You can download the a MinGit-*.zip from the releases page of the official github repository (git-for-windows/git). Unzip the folder and add only the cmd\ subdirectory to PATH.

I automated the process, have a look at this Powershell Script: https://gist.github.com/rapgru/561df5b95fb0a78f5934efefb19ea236

It automatically fetches the latest version and places it into AppData\Local

| |

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.