Skip to main content
IST-ASAG
 

Using Cygwin for CVS & SVN Repository Access

Audience

Windows users who could benefit from having a Unix-like shell environment running on their desktop, especially those who wish to use CVS and/or Subversion repositories from the command-line.

Purpose

To describe installation and configuration of Cygwin for CVS and/or Subversion repository access

Prerequisites

  • A modern, well-equipped workstation.
  • An up-to-date, patched, appropriately configured, and secure Windows operating system.
  • A fast network connection
  • An up-to-date version of an SSH client (The software-central site has SSH2 clients for Mac and Windows users)
  • An account on a server that hosts a code repository (e.g., svn.berkeley.edu, or canvas.berkeley.edu), with appropriate group memberships (e.g., cvsusers, aswa)

Installation & Configuration Steps

Install Cygwin

To install Cygwin, point your browser at the Cygwin website and follow instructions on the site's home page to install using setup.exe. It is strongly advised that you:

  • Install to a directory that has no spaces in its name, e.g., C:\cygwin.
  • Install the (most recently released) base installation before adding additional Cygwin packages (this is an especially effective strategy because not all Cygwin mirrors host all the available packages, and installations can bomb partway-through if the specified packages aren't available on the selected mirror-site; the base installation is likely to be hosted on all mirrors)
  • Once the base installation is successful, run setup.exe again to install the CVS and/or Subversion packages (both in the Devel category). There is only one CVS package. The Subversion package you'll need to access a remote Subversion repository is the one simply labeled subversion.
  • You may also want to run setup.exe to add additional packages, such as your favorite Unix text editor, etc.

Accessing Subversion Repositories from the Cygwin command line

You must define the environment variable SVN_SSH in the Cygwin environment in order to access a Subversion repository over the svn+ssh protocol. This environment variable must point to an SSH executable on your path. If you are a UC Berkeley developer and have installed the SSH Secure Shell client maintained at the Software Central website, the ssh2.exe executable is probably on your path already. In that case, you will set SVN_SSH as follows in a Cygwin shell:

        export SVN_SSH=ssh2
      

You should now be able to access projects using the svn command. For example, for the user bill to check out the trunk of a project called myproject from a repository at /users/svn/berkeley/projects/ist/as/webapps on the host svn.berkeley.edu, the following would effect the checkout (to a directory called mydir in the current directory):

        $ svn co svn+ssh://bill@svn.berkeley.edu/users/svn/berkeley/projects/ist/as/webapps/myproject/trunk mydir
      

Accessing CVS Repositories from the Cygwin command line

You must define two environment variables in the Cygwin environment in order to access a CVS repository:

CVS_RSH

This environment variable must point to an SSH executable on your path. If you are a UC Berkeley developer and have installed the SSH Secure Shell client maintained at the Software Central website, the ssh2.exe executable is probably on your path already. In that case, you will set CVS_RSH as follows in a Cygwin shell:

            export CVS_RSH=ssh2
          
CVSROOT
This environment variable describes the location of the repository you wish to access. For example, for the user bill to check out projects from a repository at /usr/local/cvsrep/org/ist on the host canvas.berkeley.edu, the following is the way CVSROOT would be set:
            CVSROOT=:ext:bill@canvas.berkeley.edu:/usr/local/cvsrep/org/ist
          

Then, to check out the project myproject into the current directory, type at the command line:

        cvs co myproject