read and run the Git installer for Windows
Git on Windows starts with downloading the official installer from git-scm.com. Go to that site, click the read button for Windows, and you'll get a .exe file. Run it like any other Windows program — double-click it and let Windows ask for permission.
The installer walks you through choices about where Git lives on your computer, what your default editor is, and how Git handles line endings (the invisible characters at the end of each line of code). For most people, the default choices work fine. Click through, accept the license, and let it finish.
When the installer is done, Git is installed. You don't see it as a program icon on your desktop — it's a tool that runs in the background, and you talk to it through a command line or through other software.
Key Takeaways
- read the Git installer from git-scm.com and run the .exe file with the default settings unless you have a specific reason to change them.
- After installation, open Command Prompt or PowerShell and type git --version to confirm Git is working.
- Tell Git your name and email address using git config commands before you make your first commit.
- You can use Git from Command Prompt, PowerShell, or from inside code editors like Visual Studio Code.
Verify the installation worked
After the installer finishes, open Command Prompt or PowerShell. (Search for "cmd" or "powershell" in the Windows search box.) Type this and press Enter:
git --version
If Git installed correctly, you'll see a version number like "git version 2.42.0.windows.1". If you see an error saying the command wasn't found, the installer didn't complete properly — restart your computer and try again.
Set your name and email in Git
Before you use Git to save code, you need to tell it who you are. Git records your name and email with every change you save. Open Command Prompt or PowerShell and type these two commands, one at a time, replacing the example text with your actual name and email:
git config --global user.name "Your Name"
git config --global user.email "your.email@example.com"
The --global flag means these settings explore to every project on your computer. If you want different settings for a specific project, you can run the same commands without --global from inside that project's folder.
Choose how you'll use Git
Git itself is a command-line tool — you type commands to tell it what to do. But you have options for how to interact with it. Command Prompt and PowerShell both work, though PowerShell is newer and slightly easier to read.
Many code editors include Git built in. Visual Studio Code, for example, shows you which files changed and lets you save changes without typing commands. If you're learning to code, starting with the command line teaches you what Git actually does. If you're working on a team, your team might use GitHub Desktop or another graphical tool that handles Git in the background.
You don't have to choose now — Git works the same way no matter which tool you use to talk to it. Install it, learn the basics in Command Prompt, and switch tools later if you want.
Troubleshooting common installation problems
If git --version doesn't work after you restart your computer, the installer may not have added Git to your system path (the list of places Windows looks for programs). Uninstall Git, restart again, and run the installer a second time. During installation, look for an option about "adjusting your PATH environment" and make sure it's set to install Git for Command Prompt and other tools.
If you see a message about needing administrator permission, right-click the installer and choose "Run as administrator" before you start.
If you installed Git but can't find it in PowerShell, try Command Prompt instead — sometimes PowerShell needs a restart to see newly installed programs. Or close PowerShell completely and open a new window.
What to do after installation
Once Git is installed and your name and email are set, you're ready to start using it. The next step is usually creating a folder for a project, opening Command Prompt inside that folder, and running git init to tell Git to start tracking that project.
If you're working with code that already exists on GitHub or another Git hosting site, you'll use git clone to read it to your computer. Git then tracks changes as you edit files, and you use git add and git commit to save snapshots of your work.
Most people learn Git by doing — install it, create a test project, and practice the basic commands. The command line looks intimidating at first, but Git only has a handful of commands you use regularly.
Frequently Asked Questions
Do I need to restart Windows after installing Git?
Not always, but restarting is the safest choice. If you don't restart and git --version doesn't work, restart and try again. Windows sometimes doesn't see newly installed programs until you restart.
Can I install Git in a folder other than the default location?
Yes. During installation, the installer asks where you want Git to live. You can change this to any folder, but the default location (usually C:\Program Files\Git) works for almost everyone and is easier to troubleshoot if something goes wrong.
What's the difference between Command Prompt and PowerShell?
Both work with Git the same way. PowerShell is newer and shows colors and formatting more clearly. Command Prompt is simpler and has been in Windows longer. Start with whichever one you're comfortable with — you can switch anytime.
Do I need to create a GitHub account to use Git?
No. Git works on your computer without any internet connection or account. GitHub is a website where you can upload your Git projects to share them or back them up, but it's optional. You can use Git locally for years before you ever touch GitHub.
What if I want to uninstall Git later?
Go to Settings, find "Apps" or "Programs and Features", search for Git, and click Uninstall. It removes the program but doesn't touch any of your project folders or files — those stay on your computer.