Install Git for Windows – Complete Beginner's Guide
Git is one of the most essential tools for modern software development. Whether you're working on a personal project or collaborating with a team, Git helps you track changes, manage different versions of your code, and safely experiment with new features without losing your work.
In this FastAPI course, we'll use Git to manage our source code and GitHub to store our projects online. Before we can do that, we need to install Git for Windows.
This guide will teach you how to download, install, verify, and configure Git on a Windows computer.
What is Git?
Git is a distributed version control system (DVCS) created by Linus Torvalds in 2005. It allows developers to record every change made to a project, making it easy to review history, restore previous versions, and collaborate with others.
Unlike cloud storage services, Git tracks the history of every file in your project, making it an essential tool for professional software development.
Why Do We Need Git?
Throughout this FastAPI course, Git will help us:
Track changes in our source code
Restore previous versions if something goes wrong
Collaborate with other developers
Upload projects to GitHub
Download existing projects
Manage different development branches
Maintain a complete history of project changes
Learning Git is an important skill for every Python and FastAPI developer.
System Requirements
Before installing Git, ensure your computer meets these requirements:
Requirement | Minimum |
|---|---|
Operating System | Windows 10 or Windows 11 |
RAM | 4 GB (8 GB recommended) |
Storage | 500 MB free space |
Internet | Required for download |
Git is lightweight and runs smoothly on most computers.
Download Git for Windows
Always download Git from the official Git website.
Official Download Page
https://git-scm.com/downloads/win
The website automatically detects your operating system and recommends the correct installer.
Install Git for Windows
Step 1
Open your Downloads folder.
Locate the downloaded installer.
Example:
Git-2.xx.x-64-bit.exeDouble-click the installer.
Step 2
If Windows displays a security prompt:
Do you want to allow this app to make changes?Click:
YesStep 3
The Git Setup Wizard will open.
Click:
NextStep 4
Choose the installation location.
The default location is recommended.
Click Next.
Step 5
Select Components.
The default options are suitable for most users.
Recommended options:
Windows Explorer Integration
Git Bash Here
Git GUI Here
Git LFS (Large File Support)
Associate
.git*configuration files
Click Next.
Step 6
Choose the Default Editor.
Select:
Use Visual Studio Code as Git's default editorIf Visual Studio Code does not appear in the list, select another editor for now. You can change it later.
Click Next.
Step 7
Adjust the Initial Branch Name.
Select:
Let Git decideor
Override the default branch name for new repositoriesIf available, use:
mainModern Git repositories use main as the default branch.
Step 8
Adjust your PATH Environment.
Select:
Git from the command line and also from 3rd-party softwareThis option allows Git to work from Command Prompt, PowerShell, and Visual Studio Code.
Click Next.
Step 9
Choose the HTTPS Transport Backend.
Keep the default option:
Use the OpenSSL libraryClick Next.
Step 10
Choose the Line Ending Conversions.
Select:
Checkout Windows-style, commit Unix-style line endingsThis is the recommended option for Windows users.
Step 11
Choose the Terminal Emulator.
Select:
Use MinTTY (the default terminal of MSYS2)This provides a better command-line experience in Git Bash.
Step 12
Choose the Default Behavior of git pull.
Keep the default option:
Fast-forward or mergeClick Next.
Step 13
Choose Credential Helper.
Keep the default option.
Git Credential Manager helps you sign in to GitHub securely.
Step 14
Keep the remaining options as their default values.
Click:
InstallThe installation will take a few moments.
Step 15
Once the installation is complete:
Click:
FinishGit is now installed on your computer.
Verify the Installation
Open Command Prompt or PowerShell.
Run:
git --versionExample output:
git version 2.51.0.windows.1If a version number appears, Git has been installed successfully.
Open Git Bash
Right-click anywhere inside a folder.
You should see:
Open Git Bash HereClick it.
Git Bash provides a Linux-like terminal environment for Windows, making it easier to work with Git commands.
Configure Git (Recommended)
Before using Git, configure your username and email.
Replace the values below with your own information.
git config --global user.name "Your Name"git config --global user.email "your@email.com"Verify the configuration:
git config --listThese details will be attached to your Git commits.
Useful Git Commands
Command | Description |
|---|---|
| Display the installed Git version |
| Create a new Git repository |
| Show repository status |
| Stage all changes |
| Save changes to the repository |
| Display commit history |
We will learn these commands in detail later in this course.
Common Installation Problems
Git command is not recognized
Restart your computer or reopen Command Prompt.
If the problem persists, reinstall Git and ensure Git from the command line is selected during installation.
Visual Studio Code not listed as the default editor
Update Visual Studio Code and reinstall Git, or configure it later using Git commands.
Git Bash missing
Ensure Git Bash Here was selected during installation.
Unable to install
Download Git only from the official website and ensure Windows Defender or antivirus software is not blocking the installer.
Best Practices
Always download Git from the official website.
Keep Git updated.
Use main as the default branch for new projects.
Configure your username and email immediately after installation.
Learn basic Git commands before using GitHub.
Summary
Congratulations! You have successfully installed Git for Windows.
Your computer is now ready for version control using Git. In the next lesson, we will create a GitHub account and connect Visual Studio Code to GitHub so you can back up your FastAPI projects online.
Frequently Asked Questions (FAQs)
Is Git free?
Yes. Git is completely free and open-source.
Do I need Git for FastAPI?
While it's not required to run FastAPI, Git is strongly recommended for managing your projects and collaborating with others.
What is the difference between Git and GitHub?
Git is a version control system installed on your computer.
GitHub is a cloud platform where you can store and share Git repositories.
Can I uninstall Git later?
Yes. You can uninstall Git like any other Windows application.
Official Download Links
Git for Windows: https://git-scm.com/downloads/win
Git Documentation: https://git-scm.com/doc
Git Book (Free): https://git-scm.com/book/en/v2