What Is Version Control
Version control is a way to keep every past version of your work. A version is one saved state of a file.
Two saved copies
One file, saved twice. The list shows both copies.
$ lsWhat the second copy holds
The second copy adds Eggs. Nothing else moves.
$ cat shopping-v2.txtExample
$ ls
$ cat shopping-v2.txtKey points
- A file changes a little at a time.
- Each change can help or hurt.
- Version control saves a copy at each step.
- You can go back to any saved copy.
- You can see what changed between two copies.
- You can compare your work with someone else’s work.
- Without it, people save copies with names like final-v2-really-final.
- Those names lie. The history does not.
- The tool in this course keeps that history for you.
Here, the folder holds two saved copies. The second copy lists two items. Milk was there first. Eggs came second. The copy keeps both lines, so nothing is lost.
Try it Yourself
Edit the code, then press Run.
Running is simulated
Exercise
What does version control keep?