Git fundamentals
Why version control
See why a project needs a durable history instead of copies, backups, and editor undo.
8 minute lesson
You change a file, then realize yesterday’s version was better.
An editor’s undo history might help. A folder named project-final-2 might help too. But neither one gives you a reliable history of the whole project.
A version control system records meaningful project states. In Git, each recorded state is a commit. You can inspect a commit, compare it with another one, or start new work from it.
This is different from a backup. A backup protects files from loss. Git explains how the project changed and why.
Git also lets people work on separate branches. Each branch can move forward without changing the others. You combine the work when it is ready.
The important word is deliberate. Git does not record every edit automatically. You choose which changes belong together, inspect them, and create a commit.
Try this thought exercise. Imagine you changed the homepage, upgraded a dependency, and added a debug log. Would you want one commit or three? My advice is to make separate commits when each change can be understood and reversed on its own.
Lesson completed