Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

iTechGuides is reader-supported. When you buy through links on our site, we may earn an affiliate commission. As an Amazon Associate I earn from qualifying purchases. Learn more

To learn Git, start with three ideas: the working tree, where you edit files; the staging area, where you choose which changes belong together; and the commit, which saves a snapshot of what you staged. Then practise one loop until it feels routine: check the status, review the differences, stage deliberately, commit, and read the history. Branches, undoing mistakes, and remote servers all build on that loop, so it is the right place to begin.

What version control is for

Version control records how files change over time, so you can return to an earlier version, compare two versions, or find out when and why something changed. Developers use it mainly for source code, but Git works on any files: a manuscript, a website’s content, configuration files, or a folder of design notes. Git is the version-control system itself. It is the software that keeps those records.

A simple way to see the value is to follow a cycle. Before a risky edit, you save a known-good state. You make the change. You compare the result with the saved state. If the change went wrong, you go back to the earlier state. Every command in this guide is a more precise way of doing those four things.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Git is not GitHub, and Git alone is not a backup

Beginners often hear Git and GitHub mentioned together and assume they are the same thing. Git is the version-control system that runs on your computer. A hosting service is one place where a repository can be stored and shared with other people. You can learn Git entirely on your own machine, and nothing in the first half of this guide requires an account on any hosting site.

A repository on your laptop is also not a backup by itself. Its history lives inside the project folder. If that folder or its disk is lost, the history goes with it, unless you have copied the repository somewhere else, such as to a remote. Remotes are covered later in this guide.

What you need before you start

The official Git user manual is written for a specific reader. Its own description of its audience is: “This manual is designed to be readable by someone with basic UNIX command-line skills, but no previous knowledge of Git.” If you can open a terminal, change into a folder, and list its contents, you have enough to follow this guide. You do not need programming experience, although a text editor is useful for creating practice files.

Install Git and set your identity

Install Git from the official Git website, using the instructions for your operating system. Installation details differ by platform and change with each release. On the official Windows installation page, checked on 7 October 2026, Git 2.56.0 was listed as the latest version, released 28 September 2026. That page offered standalone, portable, and winget installation options. Confirm what the live page shows when you install. This guide does not verify the macOS or Linux installation steps, so follow the official pages for those systems.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
  1. Install Git using the official instructions for your system. On Windows, the official page at the time of checking showed this winget command: winget install --id Git.Git -e --source winget
  2. Open a terminal. On Windows, Git for Windows installs a Git Bash terminal; PowerShell also works for the commands in this guide. On macOS and Linux, use the standard Terminal application.
  3. Confirm the installation with git --version. The command prints the installed version number.
  4. Set your name and email address. Git attaches these to every commit you make:
    git config --global user.name "Your Name"
    git config --global user.email "you@example.com"

    Use your real name and the email address you want associated with your work. The --global flag applies these settings to every repository on your computer.

The three areas Git uses

Git organises your work into three areas. Most early confusion comes from mixing them up, so it helps to know exactly what each one holds.

Area What it holds How you move things into it
Working tree The files as they currently sit on disk, including your unsaved-to-Git edits Edit files in any editor
Staging area (index) The changes you have selected for the next commit git add
Commit A saved snapshot of the staged content, with a message and author git commit

The staging area is the step that many beginners skip, and it is what makes Git flexible. Suppose you edited three files but only two belong to the same change. You stage those two, commit them with a clear message, and leave the third unstaged for a later commit. Each commit then describes one coherent change.

Start a repository: init or clone

A repository is a project folder that Git tracks. You can create one from a folder you already have, or copy one that already exists. The two paths lead to different starting points.

git init git clone <repository-url>
Starting condition A local folder on your computer An existing repository at a URL
What Git does Creates a hidden .git folder so Git can track the directory Copies the repository, including its history, and checks out a working copy
Commits at the start None; you make the first commit yourself The existing history is already present
Typical use Starting a new project or practice folder Joining a project someone else has already set up

Option A: start a new repository with git init

  1. Create a practice folder and move into it:
    mkdir practice-notes
    cd practice-notes
  2. Initialise the repository:
    git init

    Git reports that it has created an empty repository. Nothing is committed yet.

Option B: copy an existing repository with git clone

  1. Copy the project using the address its maintainers give you:
    git clone <repository-url>

    Replace <repository-url> with the real address. Git creates a folder named after the project.

  2. Move into the new folder with cd and run git status. You should see a clean working tree, meaning there are no uncommitted changes.

Practise the core loop: inspect, stage, commit, read history

The following walkthrough uses one folder and one text file. Run it in the practice-notes folder you created above. Create a file named notes.txt in a text editor, type Shopping list on the first line, and save it.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Step 1: check the status

git status

Git lists notes.txt under “Untracked files,” which means Git sees the file but has not been asked to track it yet. Run git status before every other step. It tells you what Git thinks is happening, and reading it is the habit that prevents most mistakes.

Step 2: review the differences with git diff

git diff shows changes to files Git already tracks, compared with the last commit. A brand-new file does not appear in git diff at all until you stage it. This is why git status comes first.

Step 3: stage the file on purpose

git add notes.txt
git status

The status output now lists notes.txt under “Changes to be committed.” Name the file explicitly. Many tutorials show git add ., which stages every change in the folder, including files you did not mean to include. Use it only after you have read the status output and know that every listed change belongs in the commit.

Step 4: commit the snapshot

git commit -m "Start shopping list"

The -m flag lets you write the message on the command line. If you leave it out, Git opens a text editor so you can write one. Write messages that describe the change in plain words, because they are what you will read later.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Step 5: make a second change and compare it

  1. Open notes.txt and add a new line: – milk. Save the file.
  2. Run git status. The file now appears under “Changes not staged for commit,” because Git already tracks it.
  3. Run git diff. Lines you added begin with a plus sign, and the diff shows the exact text that changed.
  4. Stage the file with git add notes.txt, then run git diff --staged. This shows what the next commit will contain, which is useful before you commit.
  5. Commit the change with git commit -m "Add milk to list".

Step 6: read the history

git log
git log --oneline

git log lists each commit with its hash, author, date, and message, newest first. git log --oneline shows one line per commit, which is easier to scan. Pick a hash from the list and run git show <commit-hash> to see exactly what that commit changed.

Learn the next skills in order

Once the core loop feels routine, add the following skills. Each one changes how files and history move, so learn them one at a time.

Ignoring files with .gitignore

A .gitignore file is a plain text file in your repository that lists files and patterns Git should not track, such as temporary files or build output. Create it with your editor, not with a Git command. Be aware that a file Git already tracks stays tracked even if you later add it to .gitignore.

Undoing mistakes

Git has several ways to undo work, and they do different things. Discarding unstaged edits, unstaging a file, and changing the most recent commit each affect your files or history in a different way. Read the specific section of the Pro Git book on undoing before you run a command that discards work, and check git status afterwards to confirm the result.

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Branches

A branch is a separate line of commits. You use branches to try a change without disturbing the main line of work, then merge the branch back when the change is ready. Branches are the next skill to master after the core loop.

Remotes: pushing and pulling

A remote is a copy of your repository stored somewhere else, usually on a hosting service. git push sends your commits to a remote, and git pull brings changes down. Learn remotes after your local commits make sense to you, so you know which history you are sending and why.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Terminal or a graphical interface

Learn the core loop in the terminal, even if you plan to use a graphical client later. The terminal shows the exact command and output for each action, which makes it easier to see what Git is doing. Most published tutorials and official documentation are written with commands. The comparison below reflects the Pro Git book’s description of command-line use and graphical clients.

Comparison point Terminal Graphical interface
Visibility into Git’s state Shows the exact command you ran and the raw output Shows status visually, often with buttons and panels; how much detail appears depends on the client
Coverage of less-common commands Can run all Git commands, according to the Pro Git book May implement only a subset of commands, according to the Pro Git book
Following tutorials Most tutorials and reference material use commands Steps depend on the specific client; not stated for every client
Reader comfort Can feel unfamiliar at first; becomes faster with practice Often easier to start with; the Pro Git book treats the choice as personal preference

A graphical client is a reasonable choice if it helps you see staged and unstaged changes clearly. Whichever interface you pick, the three areas and the core loop are the same. Command-line knowledge carries over to any client, because the client performs the same operations underneath.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Official resources for learning

  • The Pro Git book, free online. The official Git website provides the full book to read free of charge. The book overview on the site labels it as the second edition (2014). Start with the Git Basics chapter. The Pro Git book says of that chapter: “If you can read only one chapter to get going with Git, this is it.” That is a recommendation to begin there, not a replacement for practice in your own folder.
  • Git Learn. The official Git site also offers short introductory videos and a cheat sheet. Use the cheat sheet as a quick reference once you know the commands it lists.
  • The Git user manual. This is the official reference that states the prerequisite quoted earlier in this guide. Use it to look up a command you have seen in a tutorial.
  • A printed copy (optional). The official site states that a print edition of Pro Git is available on Amazon. It is an optional offline reference; the free online edition covers the same material.

A practice plan for your first weeks

  1. Repeat the core loop on a disposable project, such as the practice-notes folder, until you can predict what git status will show before you run it.
  2. Create a branch, make a change on it, and merge it back into your main line of work.
  3. Add a remote and push to it only after your local commits make sense to you and you can explain what each commit contains.

Keep a practice log of the commands you ran and the output that surprised you. Those notes will be more useful later than any memorised list of commands.

The Bottom Line

“”

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.