Introduction
Git is a powerful version control system that helps you track changes in files, manage different versions, and quickly revert to any previous state. Unlike other version control systems that log changes as a list, Git captures complete snapshots of your files, enabling faster and more flexible version restoration.
In this guide, we will walk through the steps to install Git on Windows Server 2022 and Windows Server 2019.
Installation Guide
Step 1 - Download Git
Begin by downloading the Git installer from the official Git website.
For this tutorial, we will use Git version 2.45.1, which is the latest version at the time of writing. However, these instructions are applicable to any version of Git.
Step 2 - Launch the Git Installer
Navigate to your "Downloads" folder and double-click the Git installer file to start the installation process.
License Agreement: Review the GNU General Public License information and click "Next" to proceed.
Select Installation Directory: Choose the installation folder. The default path is C:\Program Files\Git
. Click "Next."
Step 3 - Choose Installation Options
You will be prompted to select various installation options. It’s generally recommended to stick with the default settings unless you have specific needs.
- Select Components: Accept the default components and click "Next."
- Shortcut Location: Choose where to place the Git shortcut. You can leave it at the default location.
- Default Editor: Select your preferred default Git editor. Vim is selected by default, but you may choose another editor if preferred.
- Initial Branch Name: Choose the default setting "Let Git decide" for the name of the initial branch in new repositories.
- Path Environment: Select "Git from the command line and also from 3rd-party software."
- SSH Executable: Opt for "Use bundled OpenSSH" for the SSH executable.
- SSL/TLS Library: Use the default SSL/TLS library for HTTPS connections.
- Line Ending Conversion: Accept the default settings for line-ending conversions.
- Terminal Emulator: Choose the default MinTTY terminal.
- ‘git pull’ Behavior: Accept the default behavior for the
git pull
command.
- Credential Helper: Select the default credential helper.
- Experimental Options: It’s generally best to ignore experimental options and click "Install."
- **This was the last step, so now wait for the installation to complete:
- **Once completed, click "Finish":
Step 4 - Complete the Installation
Once the installation is complete, click "Finish" to exit the installer.
Use the Windows search bar to locate and open Git Bash.
Verify Installation: Check the installed version of Git by running:
git --version
Configure Git: Set your username and email address with the following commands (replace with your actual details):
git config --global user.name "your-username"
git config --global user.email "your-email@domain.com"
Verify Configuration: Check your Git configuration with:
git config --list
Conclusion
Congratulations! Git is now successfully installed on your Windows Server, and you're ready to start using it for version control. For additional information, visit the official Git website.