A version control glossary
What is version control?
A version control system maintains an organized set of all the versions of files that are made over time. Version control systems allow people to go back to previous revisions of individual files, and to compare any two revisions to view the changes between them. In this way, version control keeps a historically accurate and retrievable log of a file's revisions. More importantly, version control systems help several people (even in geographically disparate locations) work together on a development project over the Internet or private network by merging their changes into the same source repository.
Key terms in version control
- Checking in a file or directory
- This copies your working directory back into the repository as a new version.
- Checking out files or directories
- This copies the latest revision of a file from the repository to your workspace. When you check out a directory, you check out all files and subdirectories under it.
- Committing a file or directory
- This is the same as checking in a file or directory. Often version control users will say that they have "committed a change"; this means that they made changes to their working copies of files and committed these back to the repository.
- When two developers make changes to their working copies of the same file and commit them to the repository, their work may conflict. When this happens, CVS will detect the conflict and require someone to resolve it before committing their changes.
- Combining multiple changes made to different working copies of the same files in the source repository. Merging is a strategy for managing conflicts by letting multiple developers work at the same time (with no locks on files), and then incorporating their work into one combined version. Merging works well when two sets of changes are made to different lines in a files and can be easily combined. When changes to a file are made on the same line or lines, conflicts occur, requiring someone to edit the file manually before the changes can be committed to the source repository successfully.
- A shared database with the complete revision history of all files under version control.
- Conflicts within a file created by two developers attempting to commit conflicting changes must be addressed by manually editing the file. Someone must go through the file line by line to accept one set of changes and delete the other set. Files with conflicts cannot be committed into the source repository successfully until they are resolved.
- A numbered draft of specific updates to individual files. Each time you edit a file and commit it back to the repository, the file's revision number increases.
- The numbering scheme used to identify sets of files that are tagged and named at a certain point in time.
- Your copies of the files you want to edit on your local hard disk or Unix user account. When you edit files in your workspace, they will become out of sync with the repository. That's progress! Then you need to get your changes back into the repository so that everyone else can see them.
The copy-modify-merge development cycle
Because CVS is a vastly powerful tool, the learning curve might seem formidable. Certainly there are plenty of books and web sites offering comprehensive CVS knowledge bases (many good sources are referenced at the bottom of this site's main CVS page). However, it is not necessary to digest an entire tome to be able to incorporate CVS into your software development practices immediately and effectively.
CVS allows you to work within your own development cycle while keeping track of the project's overall development cycle:
- To begin working on a project, you will need to check out the source code. You can check out either the entire CVS repository for the project, or only those modules you wish to work on.
You make your contributions to the project by modifying these files and creating new files.
This part of the cycle doesn't involve cvs directly. You modify your working copies of project files using a file editor on your local machine. You can save and compile your edited files to test how your changes affect the particular project module you are working in without affecting anyone else's work on those same project files. Nothing you do affects other project participants until you merge your changes into the project repository.
- You test and tweak your latest changes in your own workspace to make sure these work without breaking or corrupting the overall project.
Finally, you contribute back or check in your changes to the main or "top" body of project files, merging your work with the most recent working version known in CVS terminology as the head.
Committing your changes to merge with other developers' work is the most powerful aspect of CVS, but that power also makes it the most critical aspect. It's possible to get confused and accidentally overwrite someone else's changes or your own. Your contributed changes invariably will conflict with someone else's at some point. Understanding how and when to update your working copies and how to resolve merge conflicts are two particularly critical aspects of using CVS in collaborative development projects.
This copy-modify-merge cycle is repeated throughout the life of the project by all contributing developers. CVS enables everyone to work on project files simultaneously, to stay up to date on the latest changes contributed by others, and to test how their own changes affect the overall project without interrupting other developers' cycles.
If you are new to CVS, learn more at: