How Git keeps every version of your project without filling your disk
Git: why copying your project folder is not enough
final, final-2, final-really: copying a project folder feels safe until the day you need yesterday's version back. Why the copies fail, and what Git does instead.
-
1
You and your friend Rono are building a small web game, where a frog crosses a river by jumping from log to log.
-
2
Miva, a friend, plays every new version. Today she finds a bug, and you want back yesterday's version, the one that worked.
-
3
Each time something worked, you copied the whole project folder. There are four copies now, and no name says which one is yesterday's.
-
4
It gets worse. Rono added more logs to the river in his copy while you fixed the score in yours, and to get both into one game, someone has to compare every file by hand.
-
5
Keeping track of versions is called version control, and Git is the program most developers use for it. You keep one folder, and inside it Git keeps a hidden store, the repository, with every version you saved, who saved it and when.
-
6
Your folder shows one version at a time, and any other one, like yesterday's that worked, can come back from the repository. Next: what Git really keeps each time you save.
-
Go further
The real names behind the folder.