18

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!

1
  • Even the minimal versions require some components, such as a shell, because Git requires a minimal POSIX environment to invoke hooks and such. Commented Jun 2, 2020 at 22:56

5 Answers 5

19

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.

Sign up to request clarification or add additional context in comments.

4 Comments

MinGit is 100% what I am looking for. Been looking for a way to install via chocolatey, but I'm not seeing anything. I only see git and git (portable) but no minimum. Too bad.
Scoop supports MinGit if that works for you @electr0sheep
I installed git on a new Windows PC. I had seen a Windows git installation contains nearly a whole Linux OS, before, so I tried to choose the minimum options in the installer, like choosing "notepad" as the default editor. Still, it installed the same things, including VIM, nano etc. Does git really need all those Linux stuff to work on Windows? The mingw64 + usr folders take 700MB.
@DamnVegetables mingit does not install nano though. I do not know why Git installs all those tools by default. Possibly to make *NIX users feel right at home according to their website. I use Scoop so I do not need Vim or Nano installed via Git to be honest so I prefer MinGIT.
2

Those who are still looking for a silent installation use /VERYSILENT parameter during installation through git installer.

Use below Powershell script, its basically downloading the latest version from git release and installing silently with no UI. make sure to replace the latest release url at $git_latest_executable_download_url

$git_latest_executable_download_url= "https://github.com/git-for-windows/git/releases/download/v2.41.0.windows.1/Git-2.41.0-64-bit.exe"
$git_latest_executable= "$pwd\Git-64-bit.exe"

Write-Host "Downloading latest Git intaller..."
(New-Object System.Net.WebClient).DownloadFile($git_latest_executable_download_url, $git_latest_executable)
.\Git-64-bit.exe /VERYSILENT /NORESTART
Write-Host "Latest Git version been installed."

Comments

1

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

3 Comments

I tried through Chocolatey with the link you provided. It suggests choco install git -params '"/GitAndUnixToolsOnPath"' This however still installs Git Bash and GUI. Any Idea what I could do differently? I see here that I could add parameters, but I'm very unfamiliar with this chocolatey.org/packages/git
I thing you need this param: /NoShellIntegration - Disables open GUI and open shell integration ( "Git GUI Here" and "Git Bash Here" entries in context menus).
/NoShellIntegration will not do what OP is asking for chocolatey.org/packages/git#description
1

You can simply use winget which is a command-line tool for managing software packages on Windows 10 and 11, introduced by Ms as part of the Windows Package Manager. winget is included by default starting from Windows 10 version 1809 (build 17763) and in Windows 11. It's part of the App Installer package available from the Microsoft Store.

  1. Open powershell as administrator copy/paste the below command

  2. winget install --id Git.Git -e --source winget

This command will automatically download and install the latest version of Git. Follow any on-screen prompts to complete the installation.

Comments

0

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.

6 Comments

Here the maintainers say they try to "keep the size as small as possible without breaking non-interactive Git usage." MinGit is 55mb. The aforementioned two folders are less than 5mb combined. Kinda doesn't add up.. How did you arrive at that combination?
These two folders (including subfolders) are 55 MB on my machine.
I don't think you did what you say you did then, so I suggest you remove your answer. I've tested your instructions on a fresh MinGit download, which is 55MB (you're free to check for yourself), and they shrink it down to <5MB and more or less render git useless.
Don't tell me what I did or didn't! The git-core folder contains 236 files netting up to 55.3 MB.
So you ended up with Mingit. As I said, I suggest you remove the answer. It's at best redundant. I also wasn't telling you what you did or didn't do, read my comment again please.
|

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.