Whether you’re setting up Git for the first time or troubleshooting a development environment, knowing your current Git version is an important step. Git is frequently updated with new features, performance improvements, and bug fixes—so verifying your installed version helps ensure compatibility with tools, repositories, and team workflows.
In this quick guide, we’ll show you how to check your Git version using the Windows Command Prompt (CMD).
✅ Step-by-Step: Check Git Version in CMD
🔹 1. Open Command Prompt
You can launch the Command Prompt in several ways:
- Press
Win + R
, typecmd
, and hit Enter. - Or, search for “Command Prompt” in the Start menu and click on it.
🔹 2. Run the Git Version Command
In the Command Prompt window, type the following command:
git --version
Then press Enter.
🔹 3. View the Output
You should see an output like:
git version 2.42.0.windows.1
This tells you the installed version of Git on your system. If you see an error like 'git' is not recognized as an internal or external command
, it means Git is not installed properly or its path isn’t added to your system environment variables.
🛠️ What to Do if Git Is Not Recognized
If running git --version
gives you an error, here’s how to fix it:
✅ 1. Install Git
Download the latest version of Git for Windows from the official site:
👉 https://git-scm.com/downloads
Run the installer and follow the setup instructions.
✅ 2. Add Git to System PATH (If Not Already)
During installation, make sure the option “Git from the command line and also from 3rd-party software” is selected. This ensures Git is added to your system’s PATH variable, allowing it to be recognized from CMD.
💡 Why Checking Git Version Matters
- Compatibility: Ensure you’re using a version that supports required Git features.
- Security: Use the latest version to benefit from security patches.
- Tooling: Some Git-based tools or extensions may require a specific version or above.
✅ Quick Recap
Task | Command |
---|---|
Check Git version | git --version |
Fix unrecognized command | Install Git & update PATH |
🏁 Conclusion
Checking your Git version via Command Prompt is a simple but essential step in managing your development environment. With just one command, you can confirm that Git is installed and up to date. If not, the fix is straightforward—and you’ll be up and running in no time.