CVS/SSH

Note: Only team members that need to access/make changes to CVS tree will need this. If you want just to use this program download a release from files section.

Note (Important for new SF users!): You might need to login once on CVS shell before you can start using CVS on SourceForge.

  • ssh  -l username@cvs.lfc.sourceforge.net

Note: please note that if you're developing on both MS Windows and some UNIX, you might forget to reformat the text files to their traditional state (this is known as the CR/LF problem). What this basically means is that when you edit text with Windows, the default is to replace your Enter keytrokes with 0x0D 0x0A. UNIX, however, only puts in a 0x0A (if it helps, you can think of it as "\n\r" vs. "\n"). Therefore, if you edit a file under one of these OS' please make sure you properly format the file in case you moved/copied the file to another OS that could pose problems, before uploading to CVS. For .cpp files it might not matter all that much but it makes the hell of a difference in makefiles.

Disclaimer: The information below is based on my own (limited) experience with ssh/cvs, and I'm aware that some suggestions presented here may not apply to everyone, so please consult the links at the end for more information. If you have suggestions/corrections to improve this material please contact me.


Contents

  • Basic CVS Usage
  • Unix/Linux
  • Windows
  • WinCVS front-end
  • SSH identity keys
  • More CVS/SSH information

  • 1. Basic CVS Usage

    This usage should be identical under Win32 and Unix/Linux. (those instructions are for command line usage). I assume that you have ssh and cvs installed and working, if this is not the case please go first and read the Unix/Linux or Windows sections.

    1.1 checkout the whole project to a local directory

    •  go to the directory that will contain the project subdirectory
    • cvs  -d:ext:username@cvs.lfc.sourceforge.net:/cvsroot/lfc co lfc2

    You now should have a local subdirectory named lfc2 in the current directory

    1.2 update your local files from CVS server

    • go to the project subdirectory
    • cvs update -d -P

    1.3 commit your changes to the CVS server

    • go to the project subdirectory
    • cvs commit

    1.4 hint(s): 

    • you can use cvs -z9 instead of cvs to compress data transfer to/from CVS server (recommended)

    2. Unix/Linux

    2.1 SSH

    2.2 CVS

    • If your distribution doesn't include CVS visit www.cvshome.org to get and install CVS
    • set CVS_RSH=ssh. If you use bash you can add the following lines to your .bash_profile (don't forget to re-login!)

      CVS_RSH=ssh
      export CVS_RSH

    2.3 hint(s)

    • you can alias cvs='cvs -z9' to use compression without specifying -z9 every time. Add the following line to your .bashrc (don't forget to re-login!)

    alias cvs='cvs -z9'


    3. Windows

    3.1 Create a home directory

    • create a new directory as your home directory (unix-style commands will store here their configuration files), for example: c:\home
    • add set HOME=c:\home to your autoexec.bat (don't forget to restart windows!)

    3.2 SSH

    3.3 CVS

    • Get and install CVS from www.cvshome.org (if you plan to use WinCVS gui frontend you can use CVS client that is included in WinCVS distribution)
    • add set CVS_RSH=ssh to your autoexec.bat (don't forget to restart windows!)


    4. WinCVS frontend

    WinCVS is a popular free GUI frontend for CVS. You can download it from www.cvsgui.org (it include a working version of CVS).

    4.1 WinCVS configuration

    • General/CVSROOT= :ext:username@cvs.lfc.sourceforge.net:/cvsroot/lfc
    • General/Authentification: SSH server
    • optional: if you created ssh identity keys set RSA identity to your %home%/.ssh/identity file
    • optional: Globals/TCPIP compression to 9 (recommended)
    • Ports/Alternate rsh name: ssh
    • WinCVS/Home: your home directory

    4.2 hint(s)

    • ! important: if you don't use ssh identity keys you will need to type your password in the black console window that appear when you activate a CVS command

    5. SSH identity keys

    Creating those keys allow you to access SourceForge server without typing your password every time.

    Warning: the information presented here is for ssh1, and it may not be correct for ssh2. (if you can help me with the instructions for ssh2 please contact me)

    5.1 Creating SSH identity keys

    1. ssh-keygen -C your@email.address (from your local computer, you should now have to files .identity and identity.pub in your .ssh directory)
    2. copy public identity file to SF server: scp .ssh/identity.pub username@lfc.sourceforge.net:identity.pub (from your local computer)
    3. rename identity file: mv identity.pub .ssh/authorized_keys (from SF shell, after you login with ssh)

    Now you can try to login with ssh -l username lfc.sourceforge.net and you shouldn't be asked for a password. For more information regarding SourceForge access and ssh identity keys read SSH Keys and CVS/Shell Accounts.

    5.2 Using the same identity keys under Linux and Windows

    Just copy identity and identity.pub in .ssh subdirectory of your home directory on your local machine (from Linux partition to Windows or from Windows partition to Linux).

    ! Important: if you have copied identity keys from Windows partition to Linux don't forget to set access mode to 600, otherwise they will not work. (chmod 600 .ssh/identity*)


    6. More CVS/SSH information

    6.1 SourceForge documents

    6.2 General CVS information