High Performance Computing

Version Control: RCS

When you are modifying code the worst thing that could happen is for you to make a change, find your code is now broken as a result and are then unable to reverse the change. A very nice, simple, and easy to use package to get around this and keep a record of changes, versions, and to be able to recall old versions is the Revision Control System (RCS).

There are a few stages to using RCS, detailed here for an example piece of Fortran90 code called mycode.f90:

  • ci mycode.f90 : this will check your code into a repository. The first time you do this it will ask for a short project description. The default editor is vi so remember to use vi commands! This will create a file called mycode.f90,v
  • co -l mycode.f90,v : checks your code out. The option -l puts a lock on it so you wont open multiples copies and edit each independently of each other.
  • co -r1.5 -l mycode.f90,v: say you have made a few changes, the latest version is 1.7 but you want to check out ver 1.5, this command allows this.
  • rlog mycode.f90,v: shows all the versions with accompanying log notes you will have made everytime you check-in a version.
Remember, when checking in your code you only check in mycode.f90 and not mycode.f90,v. You check out mycode.f90,v however. See the man pages for co, ci, and rlog for more information

This does not even have to be used just for source code; it can be used for any PLAIN text files. It could also be used for example for version control of your latex files. You could extend its use so that you could collaborate with other people who wish to be able to access the same code as you, modify it, and send it back to you during which all changes are recorded and a new version number assigned automically.