Committing & Updating Files

Anytime you add a new file or change a file, you need to perform a "commit". Committing the file essentially takes the changes that you've made on your local machine and commits them to the CVS server. Prior to doing a commit action, it is considered good practice to perform a CVS Update, which will update your files with any changes that have been made while you were working on your files. In a team-based development environment, this will happen regularly. CVS is intelligent enough to merge changes into your files during the update process. If there are any conflicts, CVS will notify you that there was a conflict that you have to resolve. After you have performed a CVS Update, you can then do a commit of your files by right clicking on your top level folder and selecting CVS Commit.



After selecting CVS Commit, a window will pop up with a list of the files and their status. You also have the ability to insert a comment for this commit action. Comments are very useful - if you are detailed enough, they will help you when you ever have to go back a few days to look at a change that you made. Comments can also be used to store bug numbers for those who have a bug tracking system and the commit that you are doing is to fix a certain bug number. After you have entered your comment and pressed OK, your files will then be committed to CVS. You will notice in your folder that all of your files now have a green box on them indicating that the files are in CVS.

Changing Files

The whole purpose to CVS is to track changes to your files. If you make a change to a file, Tortoise will update the color of the file to let you know that you have to commit the change made. To change a file, simply open it and make the change and then save it. You will notice that the file now has an orange arrow box on it, which indicates that the file has been modified. You should now perform a CVS Update, and then a CVS Commit to update the file in CVS.

Deleting Files

Files change during development, but sometimes they can also be removed if something is deprecated. To remove a file in CVS, right click on the file that you want to remove and under CVS, choose Remove. Tortoise will now remove the file from the directory and place it in the Recycle bin. The file has been removed from your local source code, but you still need to commit that change to CVS by performing a CVS Commit.

Checking out a Module

Once a module is checked into CVS, you can check it out at anytime, and depending on your network configuration, from anywhere. To check out a module, simply right click in a folder and choose the Module to check out. Once you click OK, Tortoise will check out a clean version of your module into the folder you selected.



Checking out a Module or Files by date

At some point during your development, you may need to get an older version of a file or module. To do this, follow the instructions above on checking out a module, and before clicking OK, click the "Revision" tab. The revision tab allows you to check out files by Branch or Tag. This is beyond the scope of this tutorial. For more information on Branching and Tagging files, read the CVS Documentation. You can also choose to check out files by Date by either using the calendar or by typing in a date and time for Tortoise to use.

Installing Tortoise CVS Viewing the history of files
Comments Locked

34 Comments

View All Comments

  • skunkbuster - Wednesday, December 29, 2004 - link

    cute turtle !!
  • viscount1baby - Wednesday, December 29, 2004 - link

    Source Gear Vault (http://www.sourcegear.com/) is free for a single user. Much better if your just looking for something for yourself for home usage. It stores it's content is a sql server database too, so backup is a snap.
  • starjax - Wednesday, December 29, 2004 - link

    they all provide the same funtionality. cvsnt probably has the most documentation. and if you need to eventually use it on more systems, its scalability is cheaper.
  • Pauli - Wednesday, December 29, 2004 - link

    Hey starjax (or anyone else reading this) - I have been using Clearcase for years at work (Windows environment). Which of these free tools is closest to the Clearcase environment? I am looking only for a system that will be run on a single XP PC.
  • starjax - Wednesday, December 29, 2004 - link

    clearcase.... expensive, administrative heavy, resource heavy (server side). Used only in environments where there are many software/revisions to track. WHere I work we have the largest install base for clearcase and run the largest vob's (up to 100gig). yes thats what I said. most vobs are aroun 3-4 gigs.
  • JCheng - Wednesday, December 29, 2004 - link

    Here's a list of improvements Subversion holds over CVS:

    http://svnbook.red-bean.com/en/1.0/ch01s03.html

    For me, it's hard to imagine using source control without atomic commits (which SVN has and CVS doesn't), but then, I cut my teeth on Perforce which has had them forever.
  • neogodless - Wednesday, December 29, 2004 - link

    Well I can't get past the step of creating my first module... "bad login or user" sort of error every time. No idea how to get past that. There's nowhere to even enter a password....
  • Jason Clark - Wednesday, December 29, 2004 - link

    WooDaddy, never used ClearCase.. Either CVS or Subversion should handle just about any project though.
  • Jason Clark - Wednesday, December 29, 2004 - link

    ncage, yep the old visual source safe was a joke. However, from what i hear the new Team System stuff coming out with Visual Source Safe 2005 is supposed to be very slick. I linked to it in alternative source control products.
  • WooDaddy - Wednesday, December 29, 2004 - link

    How does this compare to ClearCase?

Log in

Don't have an account? Sign up now