Adding a project to CVS(version control)

CVS comes preinstalled in Mac OS X.

Here is what I did to setup and use a local cvs repository:

  1. Make a directory called cvsroot on Desktop
  2. Edit ~./bash_login and add the command export CVSROOT=~/Desktop/cvsroot
  3. Run the command cvsinit in the Terminal
  4. cd to the project directory you want to place under version control
  5. Suppose your project directory is called project, type in cvs import -m "Program" project sample start
  6. You should get bunch of output followed by the message No conflicts created by this import
  7. Let us say you want to checkout the code you have just placed. Simply navigate to a directory where you want to store the checked-out project and type in cvs checkout project
  8. If you made changes and want to commit your changes to the repository–say you added a variable called int x; C file called foo.c, simply type in cvs commit -m "Added a variable" foo.c after navigating to the directory where your modified file is

There is much more to CVS, here is an Apple tutorial on the subject.

this seems to be a good, if somewhat dated, tutorial.


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s