0Day Forums
How to install git on Windows 10 without Git Bash or GUI? - Printable Version

+- 0Day Forums (https://zeroday.vip)
+-- Forum: Coding (https://zeroday.vip/Forum-Coding)
+--- Forum: PowerShell & .ps1 (https://zeroday.vip/Forum-PowerShell-ps1)
+--- Thread: How to install git on Windows 10 without Git Bash or GUI? (/Thread-How-to-install-git-on-Windows-10-without-Git-Bash-or-GUI)



How to install git on Windows 10 without Git Bash or GUI? - Mrmanasezdedjnalg - 07-21-2023

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!




RE: How to install git on Windows 10 without Git Bash or GUI? - ziadjszqp - 07-21-2023

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.

[To see links please register here]


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

[To see links please register here]




RE: How to install git on Windows 10 without Git Bash or GUI? - Bibi823206 - 07-21-2023

You can use MinGit

MinGit is provided on the Git for Windows repository

[To see links please register here]


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


RE: How to install git on Windows 10 without Git Bash or GUI? - fugitive251 - 07-21-2023

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.


RE: How to install git on Windows 10 without Git Bash or GUI? - Lilyan557885 - 07-21-2023

> 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][1] 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."


[1]:

[To see links please register here]