Tuesday, August 22, 2006

How to use CVS from the Command Line in Windows

I was given CVS access to pear, and had been using TortoiseCVS for long enough to think I was comfortable with it.

Sadly, I wasn't. I was ALSO too embarrassed to ask for help. I mean, shouldn't the mystery of CVS be instantly obvious? TortoiseCVS just had me plain confused.

So; in 27 or less easy steps, here's the best way to use CVS. On Windows.

  1. Download CVS. Try the latest stable version of CVS for windows.
  2. Unzip the archive, which just contains cvs.exe. Put it in your path, somewhere. For instance, c:\windows\ is an ideal place.
  3. Start Menu
  4. Run
  5. Type 'cmd'
  6. This is the command line. How scary. All Black and White and blinking at you.
  7. Type 'cvs'. If you've screwed up step #2, you'll get a file not found error. Go back and try again.
  8. The next thing we want to do is find a CVS server, and login to it. We'll try the PHP one. Type: cvs -d :pserver:cvsread@cvs.php.net:/repository login - if you haven't figured it out, cvsread is your username, and cvs.php.net is the server. The pserver bit is just the method you intend to use to login with. phpfi is the password.
  9. Alrighty: time for our first checkout. Type: cd \, mkdir pear-cvs, cd pear-cvs, cvs -d :pserver:cvsread@cvs.php.net:/repository checkout pear
Voila! Checked out. Trundle off and make changes as you please. Now, cvsread is the PHP anon. checkout account - you can't commit back changes. But, if you could... well, updating via the command line without setting your CVSROOT environment varible is a PITA. Now I'd use tortoise CVS to handle the updating and the committing.
Post a Comment