coldwa.st
All guidesProgrammingWebDataToolsDatabasesHaskellConceptsCabal & buildsToolchainCompilerPerformanceEditor & HLS

Programming · tools · version control

What is Git?

By ColdwastUpdated Jun 14, 20267 min read#git#tools#workflow
Lines of source code on a dark screen
Lines of source code on a screen — Git records the full history of changes to code like this.

If you write code, you will meet Git within a day. It is the tool nearly every software project uses to track changes, and the foundation under GitHub, GitLab and the modern developer workflow. This guide explains what Git is, the handful of concepts that make it click, why it matters, and how it differs from GitHub.

The short definition

Git is a distributed version-control system: it records the history of changes to a set of files so you can review, branch, merge, collaborate and roll back. Created by Linus Torvalds in 2005 to manage the Linux kernel, it is now the de-facto standard. "Distributed" means every copy of the project carries its full history — you can work, commit and view history entirely offline.

The core concepts

  • Repository (repo) — the project folder plus its entire history, stored in a hidden .git directory.
  • Commit — a saved snapshot of your files at a point in time, with a message describing the change. History is a chain of commits.
  • Branch — a movable pointer that lets you develop a feature in isolation without disturbing the main line (usually main).
  • Merge — combining the changes from one branch into another.
  • Remote — a shared copy of the repo hosted elsewhere (e.g. on GitHub) that you push to and pull from.
A terminal prompt on a screen
A terminal prompt — Git is most often driven from the command line, though editors and GUIs wrap it too.

The everyday workflow

The loop most developers run dozens of times a day:

git clone <url>      # copy a repository locally
# ...edit files...
git add .            # stage the changes you want to save
git commit -m "Add login form"   # save a snapshot with a message
git push             # send your commits to the shared remote

To work on something new without breaking the main line, you branch: git checkout -b my-feature, commit there, then git merge (often via a pull request) back into main. To bring in others' work, you git pull.

Why Git matters

  • History and undo — every change is recorded, so you can see who changed what, when and why, and roll back a mistake.
  • Collaboration — many people can work on the same project in parallel on branches, then merge safely.
  • Safe experimentation — branch off, try something, throw it away if it fails — the main line is untouched.
  • It is everywhere — open source, companies, CI/CD pipelines and deployment all assume Git.

Git vs GitHub

They are constantly confused. Git is the version-control tool that runs on your machine. GitHub (like GitLab or Bitbucket) is a hosting service that stores Git repositories online and adds collaboration features — pull requests, issues, access control, CI. You can use Git with no GitHub account at all; GitHub is one popular place to put a Git remote, not Git itself.

The honest learning curve

Git is powerful, and its command set can feel confusing at first — merges can conflict, and a few commands can rewrite history in ways that surprise beginners. The good news: 90% of daily work uses just clone, add, commit, push, pull and branch. Learn those well, and pick up the rest (rebase, stash, reset) when you actually need them.

FAQ

Is Git the same as GitHub? No. Git is the version-control software on your computer; GitHub is an online service that hosts Git repositories and adds collaboration tools. Git works without GitHub.

What is a commit? A saved snapshot of your project at a moment in time, with a message describing what changed. A project's history is a sequence of commits.

Do I have to use the command line? No — editors (VS Code) and GUI clients wrap Git — but the command line is universal and worth learning, since every tutorial and CI system speaks it.

What does "distributed" mean? Every clone of a Git repository contains the full history, so you can commit, branch and browse history offline. There is no single central copy you depend on to work.

Git tracks the code; the algorithms and APIs are what that code expresses. Browse more clear explainers in our guides index.

Independent, community-maintained guide. coldwa.st is a programming-resources site; this article is new, original explanatory writing about Git. Commands reflect standard Git behaviour — verify against the official Git documentation for details and edge cases.