How to Verify Git Installation on Windows – Complete Beginner's Guide
After installing Git for Windows, it's important to verify that the installation was successful. Verifying the installation ensures that Git is correctly installed, accessible from the command line, and ready to use with Visual Studio Code, GitHub, and FastAPI projects.
In this guide, you'll learn several methods to verify your Git installation, troubleshoot common issues, and confirm that Git is properly configured on your Windows computer.
Why Verify Git Installation?
Installing Git is only the first step. Before creating repositories or connecting to GitHub, you should ensure that:
Git is installed correctly.
Git commands work in Command Prompt and PowerShell.
Git Bash is installed.
Git is added to the Windows PATH.
Your Git version is up to date.
Verifying the installation now can save you time and prevent issues later.
Prerequisites
Before following this guide, ensure that:
Git for Windows is installed.
You have restarted your computer (recommended after installation).
Command Prompt or PowerShell is available.
Method 1: Verify Using Command Prompt
Step 1
Open Command Prompt.
You can do this by pressing:
Windows + RType:
cmdand press Enter.
Step 2
Run the following command:
git --versionIf Git is installed correctly, you should see output similar to:
git version 2.51.0.windows.1Note: The version number may be different depending on the latest Git release.
If you see a version number, Git has been installed successfully.
Method 2: Verify Using PowerShell
Open Windows PowerShell.
Run:
git --versionExpected output:
git version 2.51.0.windows.1If the command runs successfully, Git is available in PowerShell.
Method 3: Verify Using Git Bash
Step 1
Right-click anywhere inside a folder.
Select:
Open Git Bash HereStep 2
Run:
git --versionYou should again see something similar to:
git version 2.51.0.windows.1This confirms that Git Bash is working correctly.
Method 4: Check Git Location
You can also verify where Git is installed.
Open Command Prompt and run:
where gitExample output:
C:\Program Files\Git\cmd\git.exeThis shows the location of the Git executable on your computer.
Method 5: Verify Git Configuration
If you configured Git during installation, verify your username and email.
Run:
git config --listExample output:
user.name=John Doe
user.email=john@example.comIf these values appear, Git has been configured successfully.
Method 6: Test a Basic Git Command
Run:
git helpor
gitGit should display a list of available commands.
Example:
usage: git [--version] [--help] <command> [<args>]This confirms that Git is functioning correctly.
Verify Git in Visual Studio Code
Step 1
Open Visual Studio Code.
Step 2
Open the integrated terminal.
Shortcut:
Ctrl + `Step 3
Run:
git --versionIf a version number appears, Visual Studio Code can access Git successfully.
Verify Git Integration in VS Code
Click the Source Control icon on the left sidebar.
If Git is installed correctly, VS Code will display options such as:
Initialize Repository
Open Repository
Clone Repository
This confirms that Visual Studio Code has detected Git.
Common Error Messages
'git' is not recognized as an internal or external command
Example:
'git' is not recognized as an internal or external command,
operable program or batch file.Solution
This usually means Git was not added to the Windows PATH.
To fix it:
Restart your computer.
Reopen Command Prompt.
Reinstall Git.
During installation, select:
Git from the command line and also from 3rd-party softwareGit Bash Is Missing
If Open Git Bash Here does not appear:
Restart Windows.
Reinstall Git.
Ensure Git Bash Here is selected during installation.
Wrong Git Version
If an older version appears:
Download the latest Git installer.
Install it over the existing version.
Visual Studio Code Cannot Detect Git
Open VS Code.
Run:
git --versionIf it fails:
Restart VS Code.
Restart Windows.
Verify Git is added to PATH.
Best Practices
Verify Git immediately after installation.
Always use the latest stable Git version.
Configure your username and email before creating repositories.
Keep Git updated.
Test Git in both Command Prompt and Visual Studio Code.
Summary
Congratulations! You have successfully verified that Git is installed and working correctly.
Your Windows computer is now ready for professional version control with Git. In the next lesson, we will create a GitHub account and connect Git to GitHub so you can store your FastAPI projects online.
Frequently Asked Questions (FAQs)
Why should I verify Git after installation?
It confirms that Git is installed correctly and available from your terminal and development tools.
Which command checks the Git version?
git --versionWhat should I do if Git is not recognized?
Restart your computer. If the problem continues, reinstall Git and ensure it is added to the system PATH.
Can I use Git without GitHub?
Yes. Git works completely offline. GitHub is only used for hosting and sharing repositories online.
Official Resources
Git Downloads: https://git-scm.com/downloads
Git Documentation: https://git-scm.com/doc
Git Book (Free): https://git-scm.com/book/en/v2