← All topics

GIT & VERSION CONTROL · REFERENCE

Version Control Explained

Understand history, snapshots, local work, and why Git and an online hosting service are separate.

At a glance

Term or command What it means When to use it
Version control A system for recording and comparing changes over time. Use when you need a reliable history instead of many final-final folders.
Repository A project’s Git history and related metadata. Create one for the project you want to track.
Commit A recorded snapshot with an author, message, and links to its parent history. Record a meaningful unit of work.
Working tree The checked-out project files you edit. Make and test changes here.
Staging area The selected content for the next commit. Choose which changes belong together.
Git host A service storing remote Git repositories and collaboration features. Use when sharing or keeping a remote copy.

Commands are examples, not an interactive terminal. Run them in your own learning repository after checking the prerequisites. Output, paths, commit IDs, and wording can vary. Host-specific instructions are labeled.

A history rather than a pile of copies

Imagine changing a homepage heading on Monday and its colors on Tuesday. Two commits give those changes names and an order. You can compare versions and understand the reason for each edit. Git tracks many kinds of files; text changes are especially easy to review. Large binary files need more planning.

First page → Updated heading → Added colors
 commit A       commit B         commit C

Git, GitHub, and other systems

Git is a distributed version-control system. A normal full clone contains the repository’s history, so much daily work happens offline. GitHub is one hosting service, alongside GitLab, Bitbucket, Codeberg, and Azure Repos. You can also host repositories yourself. Signing into one host is not a requirement for Git itself.

Version control is the broad category. Git is one system within it. Other systems include Subversion and Mercurial; their commands and workflows differ from Git. This guide teaches Git.

Three places a change can exist

Editor saves file → Working tree
git add           → Staging area
git commit        → Local history
git push          → Configured remote

A staged version can differ from a file you edited again afterward. Commit normally records the staged content, not every current file automatically. A push transfers committed history rather than unsaved text.

History is useful, but storage still matters

Local Git history lives on your computer. Losing that disk can lose the project and its local history. A remote copy can help, but only includes what you actually sent. Keep appropriate backups for uncommitted work, untracked files, and other important data too.

Sources and further reading

Study questions

Explain it in your own words, then open the answer.

Is GitHub required to use Git?

No. Git works locally, and a remote can use another service or a server you control.

Is every save a commit?

No. Saving writes the file. A commit records selected content in history.

What does distributed mean here?

A normal full clone has its own repository history and can make local commits.

Are all version-control systems Git?

No. Git, Subversion, and Mercurial are different systems.

Does a remote include my unsaved edits?

No. A push sends commits, not unsaved editor text.