CVS Brainfog
May 11, 2005 3:44 PM   Subscribe

CVS question: This thread is of some help, but I'm still failing to grasp a fundamental facet of CVS use, and no matter how much documentation I read, I can't seem to figure it out.

I'm working on a couple PHP projects and a Java project, all in Eclipse. I work on it them a bit at the office, and then a little at home. I'd like to be able to check in what I've done at the office, and then have access to my latest changes from home. Sounds like a pretty elementary use of CVS, no?

What I can't figure out is: not being a large enterprise with acres of Unix servers, where can I set up a repository for myself? Can I use a directory on an FTP site? Some other means?
posted by yalestar to Computers & Internet (9 answers total)
 
You should probably skip CVS entirely and use SubVersion.

You'll need a server that you can access from home and work, since both SVN and CVS have their own daemons that handle the business end of things, FTP has nothing to do with it.

You could probably also run SVN's daemon on your workstation, check in and out locally there, and then do some SSH port forwarding from home to get at it.
posted by cmonkey at 3:52 PM on May 11, 2005


What cmonkey said about using subversion.
posted by SpecialK at 3:59 PM on May 11, 2005


you can run cvs on any machine that you can access from both work and home. wincvs runs on windows machines (and includes the cvs server), so your work desktop machine may be suitable (if you can access it from home, presumably using an ssh tunnel to get through your company's firewall). if you don't need to use ssh you should worry about how secure things are - you are probably exposing your company's code to the public!
posted by andrew cooke at 4:05 PM on May 11, 2005


Also, if you haven't seen it, Red Bean's Open Source Development with CVS book (free to read online) is a great resource for using CVS and administering a CVS server, whether you're working on an open-source project or not.
posted by esd at 4:08 PM on May 11, 2005


You could also use a flash drive, and before you leave work check out the latest version of the repository to the drive. Then you can just take it home, make your changes to the files on the drive, then bring it back into work and check them in. That way, you don't have to worry about exposing your repository to the Internet at large or setting up a VPN for security.
posted by cerebus19 at 5:15 PM on May 11, 2005


Best answer: While Subversion is indeed a decent version control system, I think it's bad form to suggest it when the OP is clearly asking for CVS advice. It was not what yalestar was asking for, and considering CVS's maturity, stability, portability, wealth of documentation and so on, Subversion might just be a bad idea at this point.

esd's recommendation is the place to start. The CVS book is probably the best CVS primer around.

To answer the OP's question: As you have surmised, you need to store the repository on a machine that is accessible from both locations. CVS can access a repository through the file system (so you can use Windows file sharing and/or Samba), through SSH (Secure Shell, a common access mechanism available on Unix and Windows; Eclipse has SSH support built in) or through a special server mode called pserver.

If your home machine isn't turned on at all times, or if your employer won't let you have a SSH-accessible shell account on a Unix server, as a last resort you can look for a cheap Unix shell hosting provider. All you need is the shell access. Assuming you're yalestar and your box (rented or otherwise) is my.host.com, and that you've run cvs init on a repository in ~/cvs, you can access the repository from anywhere in the world using the CVS root :ext:yalestar@my.host.com:~/cvs.

You can enter this root into Eclipse -- remember to tell it to use SSH -- but I also recommend playing with the console CVS client. There's nary a thing that the console client does thtat Eclipse can't do that, but sometimes you will find yourself in a position where Eclipse is out of reach, or you want to pipe some output through some Unix program, for example. Also, about every tutorial or example out there uses the console client.

One final caveat -- Eclipse does not support file-system-based repositories -- it's a network client only. Wherever you choose to store the repository, it must be reachable by Eclipse through SSH (no-brainer if your desktop box is Unix) or pserver.
posted by gentle at 5:50 PM on May 11, 2005


If you don't have to use cvs, (or subversion), don't.

You should really think about a more modern changeset oriented source control tool (rather than a filesystem based one) such as darcs.
posted by cytherea at 7:57 PM on May 11, 2005


a comparison of many version control systems

Most of the alternatives have some advantage over CVS, but really, CVS perfectly good. I even still use plain RCS for some very simple projects. I do think that darcs, arch, or something along those lines is the way of the future, though.
posted by hattifattener at 8:24 PM on May 11, 2005


sourceforge.org is one way to set up a cvs repository. It's kind of a pain to set up projects but it's free (at least, I think it is).

If one of your two machines can access the other via ssh, then you can get cvs to work fine. Set up on the repository that you can ssh to. Say you put it in /usr/local/cvs/cvsroot

The box with the repository will access it locally: CVSROOT=/usr/local/cvs/cvsroot

The other box will access it via ssh:
CVSROOT=otherbox:/usr/local/cvs/cvsroot

Nothing could be simpler. Now setting up a repository and importing a project... well, consult the man/info pages, or get the book. It's not impossible but it's not nearly as easy as setting the cvsroot.


Another option outside cvs is to use something like rsync. This is not a version control system of any kind, it's just a way to keep 2 filesystems, be they local to each other or remote, in sync.
posted by RustyBrooks at 5:41 AM on May 12, 2005


« Older I'm tired of stuff being stolen from my deck...   |   New home septic tank Newer »
This thread is closed to new comments.