3.1. Motivation for Version Control
Using version control gives several important advantages over the alternative of not using any version control system at all:
-
You won't lose your code by accident. Having a version control system, preferably with a remote service, will mean you're going to have another place where your code is stored. If several developers are working on the code simultaneously, then each one of them will have a copy of the entire code (or, in some cases, even the entire history).
-
It allows you to keep historical versions of the code, for easy reverting, comparison and investigation.
Let's say you introduced a bug. With a version control system you can easily revert to a previous version of the code where the bug was not present to verify that it did not exist there. Then you can diff the results, or even bisect the history to find the exact check-in that introduced this bug.
-
It allows one to maintain several simultaneous lines of code (normally called "branches") and to easily compare between them and merge them.
Finally, you'll find using a modern and high-quality version control system a more convenient and more robust solution than using archives (such as .zip files) and patches. There are plenty of open-source and gratis version control systems, some of which are highly mature and esteemed and you shouldn't have a problem finding something that suits you.