Chapter 68. Put Everything Under Version Control

Diomidis Spinellis

image with no caption

PUT EVERYTHING IN ALL YOUR PROJECTS UNDER VERSION CONTROL. The resources you need are there: free tools like Subversion, Git, Mercurial, and CVS; plentiful disk space; cheap and powerful servers; ubiquitous networking; and even project-hosting services. After you’ve installed the version control software, all you need in order to put your work in its repository is to issue the appropriate command in a clean directory containing your code. And there are just two new basic operations to learn: you commit your code changes to the repository and you update your working version of the project with the repository’s version.

Once your project is under version control, you can obviously track its history, see who wrote what code, and refer to a file or project version through a unique identifier. More importantly, you can make bold code changes without fear—no more commented-out code just in case you need it in the future, because the old version lives safely in the repository. You can (and should) tag a software release with a symbolic name so that you can easily revisit in the future the exact version of the software your customer runs. You can create branches of parallel development: most projects have an active development branch and one or more maintenance branches for released versions that are actively supported. ...

Get 97 Things Every Programmer Should Know now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.