How to Install Git on Windows Using Chocolatey?
Git is a FOSS (Free and Open Source Software) that is used to for version control of any set of files, typically, the source code of software projects. It is distributed under the GPL-2.0-only license. Git was originally authored by Linus Torvalds, to aid in the development of the Linux OS. It was developed further and released on 7 April 2005.
Its main features are speed, data integrity, and support for distributed, non-linear workflows (thousands of parallel branches running on different systems).
What is Chocolatey?
Chocolatey is a package manager for Windows based on Nuget, initially released on 23 March 2011. It simplifies the process of installing and downloading software on Powershell. Fun fact: Chocolatey is a pun on the term ‘Chocolate Nougat’.
PackageManagement (formerly OneGet) was released by Microsoft in April 2014, with the objective to integrate package managers into PowerShell. It was pre-configured to browse the Chocolatey repository.
Chocolatey is licensed using the Apache License 2.0.
A Windows PC with a valid installation of Chocolatey
Procedure to install Git in Windows Using Chocolatey
Step 1: Open Powershell as an Administrator in Windows.
Step 2: Check if Chocolatey is installed, by typing the following in the Powershell Terminal:
If the displayed output is not, as shown above, Chocolatey is not installed in the system.
Step 3: If Chocolatey is not installed, you can install it by typing the following in the Powershell Terminal.
Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString(‘https://community.chocolatey.org/install.ps1’))
Step 4: Type the following command in the Powershell Terminal to install git:
choco install git.install
Step 5: Verify if git is installed successfully, by searching for git in Windows Search.
If you are able to find Git after searching for it, then the installation was successful.