我想在Windows 10上安装Git,但不需要使用Git Bash或GUI。我想在PowerShell中使用Git,并且不想使我的计算机臃肿。我知道安装大小很小,但这不是问题所在。
我已经尝试了从git-SMC/Git for Windows安装程序几次,但似乎无法选择不安装GUI和Bash。有任何想法如何解决吗?也许Chocolatey能有所帮助吗?
提前感谢!
我想在Windows 10上安装Git,但不需要使用Git Bash或GUI。我想在PowerShell中使用Git,并且不想使我的计算机臃肿。我知道安装大小很小,但这不是问题所在。
我已经尝试了从git-SMC/Git for Windows安装程序几次,但似乎无法选择不安装GUI和Bash。有任何想法如何解决吗?也许Chocolatey能有所帮助吗?
提前感谢!
您可以使用MinGit
MinGit可在Git for Windows仓库中获得
https://github.com/git-for-windows/git/releases
但它不会随着Git Bash、GitK或Vi等预安装。
https://github.com/git-for-windows/git/releases
或者使用Chocolatey进行安装,如果这对您来说没问题的话。
https://www.jamessturtevant.com/posts/5-Ways-to-install-git-on-Windows/#using-chocolatey
choco install git -params '"/GitAndUnixToolsOnPath"'
但是这仍然会安装Git Bash和GUI。您有什么其他想法吗?我在这里看到可以添加参数,但我对此非常陌生。
https://chocolatey.org/packages/git - Laurens Hoogenboom我开始使用Git,然后删除了除以下目录之外的所有内容:
将git-core重命名为cmd并将其上移2个级别,您甚至不需要编辑您的.gitconfig。
对我来说非常好用。
$git_latest_executable_download_url
处替换为最新发布的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."