'How to install git on Windows 10 without Git Bash or GUI?

I am trying to install Git on Windows 10, but without Git Bash or GUI. I want to use Git in PowerShell and I would like not to bloat my PC. I know the install size is small, but that's not the issue.

I've tried going through the installer from git-SMC/Git for Windows a couple times, but it appears I can not opt out of GUI and Bash. Any idea how I can do this? Perhaps Chocolatey is of any use?

Thanks in advance!



Solution 1:[1]

You can use MinGit

MinGit is provided on the Git for Windows repository

https://github.com/git-for-windows/git/releases

It does not come preinstalled with Git Bash, GitK or Vi etc.

Solution 2:[2]

The github repo publishes portable and minimum versions of the binary releases which don't require installation. You could prune out the parts you don't want if you need to cut it down further.

https://github.com/git-for-windows/git/releases

Or instalation Using Chocolatey, if that will be ok for you

https://www.jamessturtevant.com/posts/5-Ways-to-install-git-on-Windows/#using-chocolatey

Solution 3:[3]

I started with Git and then removed everything except the following dirs:

  • \mingw64\libexec\git-core
  • \ssl

Rename git-core to cmd and move it up 2 levels and you don't even have to edit your .gitconfig.

Works like a charm for me.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1
Solution 2 Nick
Solution 3