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

  • ncage - Wednesday, December 29, 2004 - link

    ooops looks like i didn't read far enough..there are plugins for the ide. I will have to use it to see if the integration is as nice as it is with sourcesafe.
  • ncage - Wednesday, December 29, 2004 - link

    Least you guys aren't still using source safe ;). SourceSafe really sucks...its the access DB of the version control world. At work we have had so much trouble with sourcesafe corruption. We have the sourcesafe analyze utility running every night but if there is on developer that leaves sourcesafe open or VB6 with the sourcesafe add-in..the analyze will fail. The only thing nice about source safe is the IDE integration..you would have to build this for the free alternatives (if not already available) which would suck. Anyways, btw, i have used starteam and it ROCKS but very expensive.
  • Stefpet - Wednesday, December 29, 2004 - link

    SVN does not require Apache if you use svnserve. If you use svnserve you simply run it as a service similar to CVSNT.
  • Jason Clark - Wednesday, December 29, 2004 - link

    One drawback to Subversion is the Apache dependancy. There is no IIS support, at least last time I looked. It requires Apache or you have to setup a Synserve for remote access. From the time I spent with Subversion, CVSNT was much easier to setup and get going quickly.

    Just an FYI.
  • Jason Clark - Wednesday, December 29, 2004 - link

    I've listed some of the other free alternatives, and some commercial alternatives.

    Yes, CVS lacks in some areas, but for the average user CVS is more than sufficient.
  • Damien - Wednesday, December 29, 2004 - link

    CVS has many well known problems and is missing some key features. Being able to rename files/directories in Subversion and recording that name change as part of the file history is amazingly useful.

    Perforce is good from the ease-of-use angle, but it is expensive for more than two people. For that reason I moved to Subversion at work, having previously used both Perforce and CVSNT for several months previously.
  • Jason Clark - Wednesday, December 29, 2004 - link

    CVS is still very widely used and works very well. Subversion is one of many alternatives, we discussed CVS. Subversions commands are very similar to CVS, so if you get your feet wet with CVS, Subversion should be a piece of cake.
  • Stefpet - Wednesday, December 29, 2004 - link

    I would also like to recommend Subversion (http://subversion.tigris.org/) instead of CVSNT. There is also a TortoiseSVN so you may use SVN exactly as described in this article.

    Perforce is also perfect if you need a good and easy to setup system for handle your own source-code. However, if you need more than 2 users than prepare to shell out loads of cash.
  • lysinewf - Wednesday, December 29, 2004 - link

    Perforce! it's free for 2 users.
  • Souka - Tuesday, December 28, 2004 - link

    Subversion? Do share......


Log in

Don't have an account? Sign up now