GitLearnHub
Practice Flow
15px

Getting Started with Git

New to Git? By the end of this page you will know what Git is, have it installed, and be comfortable enough in a terminal to use it.

What is Git?

Git is a tool that keeps a full history of every change ever made to your project. Think of it like a save system in a video game — except instead of one save slot, you have thousands, all labelled with what changed and when. You can go back to any point in history at any time.

When you work with a team, Git also makes sure everyone's changes can be combined together without overwriting each other's work.

The four areas you need to know:

Your Files
editing right now
not tracked yet
git add
Staging Area
queued for
next commit
git commit
Your Local Copy
full history
on your machine
git push
Remote
shared with
the team

Install Git

Go to git-scm.com and click the Windows download button. Run the installer. Most options can stay as default, but pay attention to these screens:

  • "Choosing the default editor" — change this to Visual Studio Code if you use VS Code, or leave it as Notepad
  • "Adjusting your PATH environment" — keep the recommended option: "Git from the command line and also from 3rd-party software"
  • "Configuring the line ending conversions" — keep the default: "Checkout Windows-style, commit Unix-style line endings"

Once installed, open Git Bash (search for it in the Start menu) or PowerShell and verify it worked:

bash
git --version

You should see something like git version 2.47.0 (Windows builds add a .windows.1 suffix). If you do, Git is installed.

Terminal Basics

A terminal (also called a command line or console) is a text window where you type commands. You will use it to run all Git commands. There are two options on Windows:

💡
You can use either one. This guide shows both side by side. Pick the one you are most comfortable with and stick to it.

How to open a terminal:

Essential commands to navigate folders:

# Show where you are
pwd

# List files and folders here
ls

# Move into a folder
cd FolderName

# Move up one level
cd ..

# Create a new folder
mkdir my-project

# Clear the screen
clear
💡
Press Tab to auto-complete folder and file names. Press to go back to the last command you typed.

Opening a Terminal from Your IDE

You do not need to open a separate terminal window — both IDEs have one built in.

Visual Studio Code:

Visual Studio:

The IDE only changes where you open the terminal — the Git commands themselves are identical in every IDE, every editor version, and every operating system.

💡
VS Code also has a built-in Source Control panel (Ctrl + Shift + G) for staging and committing with clicks instead of commands. It is great for reviewing changes visually, but learn the terminal commands first so you understand what is happening.

Verify Your Setup

Let's make sure everything works end-to-end by cloning a real repo.

Go to any project your team has on GitLab or GitHub, copy its HTTPS clone URL (see Clone a Repo), then run:

bash
git clone <url>
cd <repo-folder>
git log --oneline -5

If you see a list of recent commits, your setup is working. You are ready to use Git.