Skip to content
GitTree

Git basics

Git for beginners: learn the basics with a GUI, step by step

New to Git? Learn the five ideas that matter (repository, commit, branch, merge and remote), then build your first project in a free Git GUI: clone or create a repository, stage, commit, branch and push.

Written by Eslam FaisalUpdated 14 min read
GitTree start page with Open, Clone and Init actions, recent and favourite repositories

Git for beginners comes down to five ideas. A repository holds your project and its history, a commit is a saved snapshot of your files, a branch is a separate line of work, a merge joins two branches, and a remote is a copy of the repository on a server such as GitHub. Learn those five and every Git tutorial starts to make sense. A Git GUI helps because it draws them for you: each commit is a dot on a graph and each branch is a coloured line, so you see what is happening instead of picturing it.

This Git tutorial explains each idea in plain words, then walks through a first project in a GUI. The app in the screenshots is GitTree, a free Git client for macOS, Windows and Linux; its maker wrote this guide. Every step also shows the matching command, so what you learn works in the terminal and in any other Git tool.

What is Git? Version control in plain words

Git is a version control system: a program that records every change you save to a set of files, so you can see who changed what and when, compare any two versions and go back to an earlier one. Think of an unlimited undo history for a whole folder, where every saved point has a name and a note explaining why.

The Linux kernel developers, led by Linus Torvalds, created Git in 2005, and it works just as well for websites, documentation or a thesis as for code. Git is distributed: every copy of a repository carries the full history, so you can commit, browse history and create branches offline. You only need the network to share work.

One common mix-up: Git is the tool on your computer, while GitHub, GitLab and Bitbucket are websites that host Git repositories so teams can share them. Our guide to Git vs GitHub explains the difference in detail.

Git basics for beginners: the five ideas to learn first

1. Repository: your project plus its history

A repository (repo) is an ordinary project folder that Git tracks. Git keeps the history in a hidden .git folder inside it. Your files stay normal files: you edit them with any editor, and Git only steps in when you ask it to record or share something.

2. Commit: a saved snapshot with a message

A commit records the state of your files at one moment, together with your name, the date and a short message such as “Add contact form”. Each commit gets a unique ID called a hash (for example a1b2c3d) and points back to the commit before it, which is how Git builds a history you can read, compare and return to.

Before you commit, you stage the changes you want to include. The staging area lets you split work into tidy commits: fix a bug and rename a variable, then commit each change on its own, even when both sit in the same file.

3. Branch: a separate line of work

A branch is a name that points at a commit and moves forward every time you commit on it. Most repositories have a main branch, usually called main (older ones often use master). When you start something new, you create a branch such as feature/contact-page, commit there, and main stays untouched until the work is ready. Branches in Git are cheap: creating one takes an instant, so use them freely.

4. Merge: bringing work back together

A merge adds the commits from one branch to another, for example your feature branch into main. If main has not moved since you branched, Git simply moves it forward (a fast-forward); otherwise it creates a merge commit with two parents. When both sides changed the same lines, Git asks you to choose: a merge conflict. It is routine, and our guide to resolving Git merge conflicts shows how to handle one calmly.

5. Remote: a copy on a server

A remote is another copy of the repository, usually on a hosting service. The one you cloned from is named origin by default. You push to send your new commits to the remote, fetch to download commits others pushed, and pull to fetch and bring those commits into your current branch. Clone copies a remote repository, with its whole history, onto your computer.

Before you start: install Git and set your name

GitTree runs on top of the Git installed on your computer and does not bundle its own, so install Git first (version 2.39 or newer). That is also why every button in GitTree does what the matching command does. On macOS, run xcode-select --install or brew install git. On Windows, install Git for Windows from git-scm.com. On Linux, run sudo apt install git on Ubuntu 24.04 or Debian 12; Ubuntu 22.04 and Linux Mint 21 ship Git 2.34, which is too old, so upgrade Git on Ubuntu first. Then check the version in a terminal:

git --version

Git writes a name and an email into every commit, so set them once. Use the email of your GitHub, GitLab or Bitbucket account if you want commits linked to your profile there:

git config --global user.name "Your Name"
git config --global user.email "you@example.com"

You can also set them without the terminal: in GitTree’s Preferences, a profile holds a name and email for commits (handy for keeping work and personal identities apart), and each repository can have its own Name for commits and Email for commits.

Step 1: clone or create your first repository

Download GitTree, install it and sign in once with a free GitTree account, which you create on gittree.app with GitHub, GitLab, Bitbucket or Azure DevOps. The first launch needs the network; after that the app works offline for up to 7 days between checks. Every new tab opens on the start page, which offers three ways in: Open, Clone and Init.

GitTree’s start page: Open an existing repository, Clone one from a URL, or Init a new one. Recent and favourite repositories are listed below.
GitTree’s start page: Open an existing repository, Clone one from a URL, or Init a new one. Recent and favourite repositories are listed below.

Clone a repository that already exists

Choose Clone, paste the repository URL (HTTPS or SSH), pick a parent folder and check the Clones into path. Leave Open after cloning ticked and choose Clone. If you have connected a GitHub or Bitbucket account, Clone from GitHub / Bitbucket… lets you pick a repository from a list instead of copying its URL. The command does the same thing:

git clone https://github.com/your-name/your-project.git
The Clone dialog: the repository URL, where it goes on disk, and options such as depth and sparse checkout that beginners can leave as they are.
The Clone dialog: the repository URL, where it goes on disk, and options such as depth and sparse checkout that beginners can leave as they are.

Or start a new repository with Init

To put an existing folder under version control, or start from scratch, choose Init. Pick the location, use main as the Initial branch, and optionally add a .gitignore template (so build output and dependencies stay out of Git) and a licence. Nothing is written until you choose Initialize. The command version:

git init -b main

Step 2: stage and commit your first change

Open the project in your editor and change something small: add a line to README.md, for example. Back in GitTree, a // WIP row appears above the newest commit on the graph, and the file shows up under Unstaged Files in the panel on the right.

  1. Stage the change. Choose Stage All Changes, or select one file and stage only that. To stage part of a file, open it and use Stage Hunk, or tick single lines and choose Stage Lines. Staged files move to Staged Files.
  2. Write a message. Type a short Summary of what the commit does, such as “Add project description to README”. A counter shows how close you are to 72 characters; longer summaries are often cut off in other tools. Add a Description if the reason is not obvious.
  3. Commit. Choose Commit Changes to 1 File (the count matches what you staged). The new commit appears at the top of the graph.
Unstaged and staged files on the right, the Summary with its 72-character counter, and the commit button, which names how many files the commit will contain.
Unstaged and staged files on the right, the Summary with its 72-character counter, and the commit button, which names how many files the commit will contain.

The same three steps on the command line:

git status
git add README.md
git commit -m "Add project description to README"

Good habits from day one: one logical change per commit, a summary that says what the commit does (“Fix login redirect”, not “stuff”), and committing often. Small commits are easier to review, explain and undo.

Step 3: create a branch, then merge it

Choose Branch in the toolbar, type a name such as feature/contact-page, make sure Check out the new branch is ticked and choose Create Branch. Make a commit or two the same way as before. The graph now shows your branch label moving ahead of main; when both branches have new commits, each gets its own coloured lane.

git switch -c feature/contact-page

When the work is ready, bring it back into main. Double-click main in the sidebar to check it out, then right-click your feature branch and choose Merge feature/contact-page into main. You can also drag the branch label onto main and pick the merge from the menu. The commands:

git switch main
git merge feature/contact-page
A branch’s right-click menu in GitTree: merge, rebase and the other actions name both branches, so you can see exactly what goes where before you click.
A branch’s right-click menu in GitTree: merge, rebase and the other actions name both branches, so you can see exactly what goes where before you click.

Step 4: push your work to GitHub or another remote

If you cloned the repository, it already has a remote called origin: choose Push in the toolbar. The first push of a new branch also sets its upstream, so later pushes and pulls know where to go. To push every time, open Commit Options and turn on Push After Commit.

A repository you created with Init has no remote yet. Run Publish Repository… from the command palette (⌘+Shift+P on a Mac, Ctrl+Shift+P on Windows and Linux): it creates the repository on your connected GitHub, GitLab, Bitbucket or Azure DevOps account, adds it as a remote and pushes the branch. See how to push a project to GitHub without the command line for every step. On the command line, after creating an empty repository on the website:

git remote add origin https://github.com/your-name/your-project.git
git push -u origin main

To get commits your teammates pushed, choose Pull; GitTree also fetches in the background, so new remote commits show on the graph first. If the remote asks who you are, connect your hosting account in GitTree, or generate an SSH key in the app and upload it to GitHub, GitLab or Bitbucket.

Your first Git project in GitTree: the short version

  1. Install Git and GitTree

    Install Git 2.39 or newer, set your name and email, then download GitTree and sign in once.

  2. Clone or create a repository

    On the start page, choose Clone and paste a repository URL, or choose Init to start a new repository in a folder.

  3. Stage a change

    Edit a file, then choose Stage All Changes, or stage single files, hunks or lines.

  4. Commit it

    Type a short summary of what changed and choose the commit button.

  5. Work on a branch and merge it

    Choose Branch to create a branch and commit there, then check out main, right-click the branch and choose Merge.

  6. Push to the remote

    Choose Push. For a repository you created with Init, run Publish Repository… from the command palette first.

Git glossary for beginners

Keep this table open while you learn Git. Each row gives a term, what it means and where you find it in GitTree.

Git terms for beginners and where to find them in GitTree
TermWhat it meansIn GitTree
Repository (repo)A project folder whose history Git tracks in a hidden .git folder.A tab; Open, Clone or Init on the start page.
Working folderThe files you see and edit on disk.The // WIP row and Unstaged Files.
Staging area (index)The changes you picked for the next commit.Staged Files.
CommitA saved snapshot of staged changes, with a message, author and date.A dot on the commit graph.
Hash (SHA)The unique ID of a commit, such as a1b2c3d.Copy Commit SHA.
BranchA name that points at a commit and moves forward as you commit.Labels on the graph and in the sidebar.
HEADWhat you have checked out right now, usually a branch.The branch picker in the toolbar.
Checkout (switch)Moving your working folder to another branch or commit.Double-click a branch label.
MergeAdding another branch’s commits to the current branch.Right-click a branch, or drag it onto another.
Merge conflictBoth branches changed the same lines, so Git asks you to choose.A three-way conflict editor.
Remote (origin)A copy of the repository on a server; origin is the one you cloned from.The Remote section of the sidebar.
CloneCopying a remote repository, with its history, to your computer.Clone on the start page.
PushSending your new commits to the remote.The Push button.
Fetch / pullFetch downloads new commits; pull also brings them into your branch.The Pull button.
.gitignoreA file listing paths Git should not track, such as build output.Ignore This File on a changed file.
StashChanges put aside without committing, to bring back later.The Stash and Pop buttons.

How to keep learning Git after your first project

The loop you just practised (edit, stage, commit, push, and a branch for anything bigger than a quick fix) covers most days with Git. When you are ready for more, learn one new idea at a time:

GitTree is free today, private repositories included. See everything it can do, or read the install notes for Mac, Windows and Linux.

Frequently asked questions

What is Git, in simple terms?

Git is a version control system: a program that records every saved change to the files in a project folder. You can see who changed what and when, compare versions, go back to an earlier state, and work on several ideas at once in branches. It runs on your own computer and works offline; you only need the network to share commits.

Is Git hard to learn for beginners?

The everyday part of Git is small: stage, commit, branch, merge, push and pull. Many beginners are comfortable with it after an afternoon of practice. What feels hard at first is picturing branches and history, which is where a Git GUI helps, because it draws every commit and branch on a graph. Advanced commands such as rebase can wait until you need them.

Should I learn Git with a GUI or the command line first?

Either works, and the best path for many beginners combines both. A GUI shows what each action does to the commit graph, so the ideas sink in faster. The command line teaches the exact vocabulary used in documentation and on servers. Using a GUI that runs real Git commands, while trying the matching commands in a terminal, builds both skills.

What is the difference between Git and GitHub?

Git is the version control tool that runs on your computer and stores the history of your project. GitHub is a website that hosts Git repositories online so people can share code, review changes and collaborate. GitLab and Bitbucket are similar services. You can use Git without any of them, and you push to them when you want a copy online.

What is the difference between staging and committing in Git?

Staging picks which changes go into the next commit; committing saves those staged changes permanently into the history with a message. Changes you do not stage stay in your working folder, untouched. The split lets you turn a messy afternoon of edits into several clean commits, each with one clear purpose, even when the changes sit in the same file.

Do I need a GitHub account to use Git?

No. Git works entirely on your computer: you can create a repository, commit, branch and merge without any account. You need a hosting account on GitHub, GitLab, Bitbucket or a similar service only when you want to back up your work online or collaborate. GitTree itself needs a free GitTree account, which you create with a GitHub, GitLab, Bitbucket or Azure DevOps account.

Is GitTree free for beginners, and what do I need to run it?

GitTree is free today for individuals and organizations, private repositories included, with no paid plan. It runs on macOS 13 or later, 64-bit Windows 10 and 11, and 64-bit Linux (Ubuntu and Debian). You need Git 2.39 or newer installed and a free GitTree account; the first launch needs the network, then it works offline for up to 7 days.

Sources

Claims about other products were checked against their official pages on October 6, 2026. Prices and features change; the vendors’ pages are the source of truth.