This article introduces how to install and configure Git on Windows 11, and how to use it. We’ll install it using chocolatey from Powershell. Git is essential in programming, not just for team work, and is also useful software for everyday work.
In this article, we’ll install Git using chocolatey.
<>
With choco on Windows and Windows 11, you can
Install chocolatey on Windows 11. Open Powershell with administrator privileges and execute the following command. To open Powershell with administrator privileges, right-click the powershell icon in the taskbar, right-click again, and select “Run as administrator”.
> Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))
If the following is displayed, the installation has completed successfully.
“Chocolatey (choco.exe) is now ready”

You can verify that the installation was successful by outputting the version.
> choco --version
0.11.3
Execute the refreshenv command.
> refreshenv
Refreshing environment variables from registry for cmd.exe. Please wait...Finished..
At this point, various programming languages, development environments, libraries, and software that can be used with choco are now installable.
From here, we’ll install Git using choco.
Install Git with the following command.
> choco install git -y
> choco install git -y
Chocolatey v0.11.3
Installing the following packages:
git
By installing, you accept licenses for the packages.
Progress: Downloading git.install 2.33.1... 100%
Progress: Downloading chocolatey-core.extension 1.3.5.1... 100%
Progress: Downloading git 2.33.1... 100%
chocolatey-core.extension v1.3.5.1 [Approved]
chocolatey-core.extension package files install completed. Performing other installation steps.
Installed/updated chocolatey-core extensions.
The install of chocolatey-core.extension was successful.
Software installed to 'C:\ProgramData\chocolatey\extensions\chocolatey-core'
git.install v2.33.1 [Approved]
git.install package files install completed. Performing other installation steps.
Using Git LFS
Installing 64-bit git.install...
git.install has been installed.
WARNING: Can't find git.install install location
git.install can be automatically uninstalled.
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.33.1 [Approved]
git package files install completed. Performing other installation steps.
The install of git was successful.
Software install location not explicitly set, it could be in package or
default install location of installer.
Chocolatey installed 3/3 packages.
See the log for details (C:\ProgramData\chocolatey\logs\chocolatey.log).
> echo $?
True

At this point, Git installation is complete, but note that you cannot use the command until you restart the console. For example, if you’re running powershell.exe, close that window and open a new one. If you’re using conemu, close conemu and open it again. Or opening a new instance is also fine.
If you run it in the same console window, you’ll get an error like the following.
> git -v
git : The term 'git' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
On the command line of the new instance console, verify the Git version with the following command.
> git --version
git version 2.33.1.windows.1