How to Use Git on Windows: A Beginner-Friendly Guide

Git is the most widely used version control system in the world, and it’s essential for developers and teams working collaboratively on code. If you’re using Windows and want to get started with Git, this guide walks you through the entire process—from installation to basic commands.


🧰 Prerequisites

Before using Git, make sure you have:

  • A Windows machine (Windows 10 or 11 recommended)
  • Administrator access to install software

✅ Step 1: Install Git for Windows

  1. Go to the official Git website:
    👉 https://git-scm.com/downloads
  2. Click “Download for Windows”.
  3. Run the installer and follow the steps:
    • Choose Git Bash as your terminal emulator (recommended)
    • Use default options unless you have specific preferences
    • Enable Git from the command line and also from 3rd-party software
  4. After installation, verify Git by opening Command Prompt or Git Bash and running: git --version

✅ Step 2: Configure Git

Set your name and email (used in commits):

git config --global user.name "Your Name"
git config --global user.email "yo******@ex*****.com"

View configuration at any time:

git config --list

✅ Step 3: Create or Clone a Repository

Create a new Git repository:

  1. Open a terminal or Git Bash.
  2. Navigate to your project folder: cd path/to/your/project
  3. Initialize Git: git init

OR Clone an existing repo from GitHub:

git clone https://github.com/username/repo-name.git

✅ Step 4: Common Git Commands

Here are some essential Git commands to get you started:

TaskCommand
Check statusgit status
Add files to staginggit add filename or git add .
Commit changesgit commit -m "Your commit message"
View commit historygit log
Add remote repositorygit remote add origin <repo-URL>
Push to remote repogit push -u origin main
Pull latest changesgit pull origin main

✅ Step 5: Use Git in Visual Studio Code (Optional)

If you’re using Visual Studio Code:

  • Open your project folder
  • Go to the Source Control tab (or press Ctrl+Shift+G)
  • Click “Initialize Repository” or start using Git right away if it’s already initialized

✅ Step 6: .gitignore and Best Practices

  • Create a .gitignore file to exclude files and folders from tracking (e.g., logs, .env, node_modules)
  • Always commit with meaningful messages
  • Avoid committing large binary files or sensitive data

📝 Summary

TaskTool / Command
Install Gitgit-scm.com
Configure Gitgit config --global
Initialize repogit init
Clone repogit clone <url>
Add & commit changesgit add, git commit
Push & pull from GitHubgit push, git pull

Getting started with Git on Windows is simple and powerful. Once installed and configured, you can manage version control for all your development projects with just a few commands.

Sharing Is Caring:

Leave a Comment