Install git on windows machine using chocolatey

Git (for Windows) – Git is a powerful distributed Source Code Management tool. If you just want to use Git to do your version control in Windows, you will need to download Git for Windows. You can choose to jump through several urls to find and download the right version or you can use the easier way. I’m going to explain the latter in this blog. For this post, you need to have Chocolatey installed on the machine. You can check here on how to do so.

Once you have done this, open a PowerShell prompt and run below one line command:

choco install git

This will ask you to confirm, say yes and then it will install the virtual box for you. Below is the sample output from my machine:

PS C:\Windows\system32> choco install git
Chocolatey v0.10.3
Installing the following packages:
git
By installing you accept licenses for the packages.

git.install v2.11.0 [Approved]
git.install package files install completed. Performing other installation steps.
The package git.install wants to run 'chocolateyInstall.ps1'.
Note: If you don't run this script, the installation will fail.
Note: To confirm automatically next time, use '-y' or consider setting
 'allowGlobalConfirmation'. Run 'choco feature -h' for more details.
Do you want to run the script?([Y]es/[N]o/[P]rint): y

Downloading git.install 64 bit
 from 'https://github.com/git-for-windows/git/releases/download/v2.11.0.windows.1/Git-2.11.0-64-bit.exe'
Progress: 100% - Completed download of C:\Users\sp_farm\AppData\Local\Temp\chocolatey\git.install\2.11.0\Git-2.11.0-64-
it.exe (32.87 MB).
Download of Git-2.11.0-64-bit.exe (32.87 MB) completed.
Installing git.install...
git.install has been installed.
WARNING: Git installed - You may need to close and reopen your shell for PATH changes to take effect.
Environment Vars (like PATH) have changed. Close/reopen your shell to
 see the changes (or in powershell/cmd.exe just type `refreshenv`).
 The install of git.install was successful.
 Software installed to 'C:\Program Files\Git\'

git v2.11.0 [Approved]
git package files install completed. Performing other installation steps.
 The install of git was successful.
 Software install location not explicitly set, could be in package or
 default install location if installer.

Chocolatey installed 2/2 packages. 0 packages failed.
 See the log for details (C:\ProgramData\chocolatey\logs\chocolatey.log).

Those who don’t know what package management is, it’s a new feature in PowerShell v5 and also runs on older version of PowerShell. More info here.

For more information on git package, check here.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s