Dualo
Git & GitHub

What is Git?

A distributed version control system. It tracks every change to your code, lets you experiment safely, and enables multiple people to work on the same project without stepping on each other.

1 min read

Git is a tool that remembers every version of your project. Each time you save a meaningful change, Git takes a snapshot — you can come back to any past state, compare versions, or branch off to try something new without losing what works.

Why it matters: without Git, you end up with final.js, final-v2.js, final-FINAL.js. With Git, you have one file, and a clean history of who changed what and why. Lost a change yesterday? Restore it in seconds.

Git is distributed: your computer holds the entire history of the project, not just the latest version. You can commit, browse history, and even branch while completely offline. Sync to a remote server (like GitHub) when you want to share or back up.

Mental model: think of Git as a time machine + parallel universes. The time machine = history of commits. The parallel universes = branches, where you can try a feature without touching the main timeline. Merge them back when you're happy.

GitHub ≠ Git. Git is the tool installed on your machine. GitHub is a website that hosts Git repositories online and adds collaboration features (issues, pull requests, code review). Other hosts exist: GitLab, Bitbucket, Gitea. The Git you learn works the same with all of them.

Practice

Complete the definition:

Git stores of your project, not diffs. Each one is identified by a hash.

Grounded on https://git-scm.com/book/en/v2/Getting-Started-About-Version-Control

Next up

Initialize a repository

`git init` turns any folder into a Git repository. A hidden `.git/` directory appears — that's where the entire history lives.