Start Kontakt

Subversion / CVS

Allgemeines

Als Versions-Kontrolle ist Subversion sehr empfehlenswert. Das kostenlose Online-Buch Version Control with Subversion ist eine hervorragende Einführung und Referenz.
Als Clients gibt es pysvn Workbench, RapidSVN oder auch TortoiseSVN.
Das Tool SubWCRev hilft die aktuelle Revision mit in den Quellcode aufzunehmen. Auch svnrev erledigt dies, aber auf leicht andere Weise.

Subversion ist mit git ein Nachfolger von CVS (auf Windows bestehend aus dem Konsolenprogramm CVSNT plus eine optionale GUI wie WinCVS oder auch TortoiseCVS).

Seit 2007 entwickeln sich auch immer mehr dezentrale Versionierungs-Systeme (DVCS) wie z.B. Mercurial (deutsch Quecksilber, daher kurz nur Hg (chem. Symbol)). Zu Mercurial/Hg gibt es auch ein kostenloses Online-Buch.

Subversion clients: svn+ssh with different users / svn+ssh mit anderen Benutzern

english With Linux/Unix
Read the OpenSSH manual section for the client configuration file ssh_config. Create a host section for the host of the svn+ssh URL and include the directives User and IdentityFile in it.

english With Windows
Needed are Putty and TortoisePLink of TortoiseSVN.
TortoiseSVN is needed as the provided TortoisePLink.exe asks for the key's password in a separate window, if the key is not loaded in Putty's PAGENT. The original PLink.exe from Putty asks only via STDIN/STDOUT, which are redirected with SVN and therefore can not be answered.

If you use the SVN console client or another 3rd party tool (e.g. pysvnWorkbench), then download TortoiseSVN and "extract" it with msiexec /a TortoiseSVN-1.n.n.nnnnn-win32-svn-n.n.n.msi into a temporary directory via the installation dialogs. Afterwards just copy TortoisePLink.exe to its final destination, e.g. into Putty's directory.

To use TortoisePLink.exe with the SVN console command or a 3rd party tool, enter TortoisePLink.exe (incl. path) in %APPDATA%/Subversion/config in the tunnels paragraph.
Example:
[tunnels]
ssh = C:/Program Files/TortoiseSVN/bin/TortoisePlink.exe

Attention!!! For the path you have to use normal slashes (/), not backslashes (\).

To use a different user with a svn+ssh URL only a session in Putty is needed, which has the exact name as the host of the URL. So for the URL svn+ssh://svn.example.com/TestRepo/trunk the Putty session must be named svn.example.com.
For the host of the Putty session you should use the same host. The correct user has to be entered under Connection → Data. Furthermore the private key for this connection should be entered under Connection → SSH → Auth.

german Mit Windows
Benötigt werden Putty und TortoisePLink von TortoiseSVN.
TortoiseSVN deswegen weil das mitgelieferte TortoisePLink.exe nach dem Schlüssel-Passwort in einem eigenen Fenster fragt, falls der Schlüssel nicht in Putty's PAGENT geladen ist. Das Original PLink.exe von Putty fragt nur auf STDIN/STDOUT danach, welche aber bei SVN umgeleitet sind und daher nicht beantwortet werden kann.

Falls man das SVN Kommandozeilen-Programm oder ein anderes Tool benutzt, dann TortoiseSVN herunterladen und mit msiexec /a TortoiseSVN-1.n.n.nnnnn-win32-svn-n.n.n.msi über die Installationsdialoge in ein temporäres Verzeichnis "entpacken". Danach einfach TortoisePLink.exe ins Zielverzeichnis kopieren, z.B. ins Putty Verzeichnis.

Damit TortoisePLink.exe auch vom SVN Kommandozeilen-Programm oder einem anderen Tool verwendet wird, muss man nur noch TortoisePLink.exe (inkl. Pfad) in %APPDATA%/Subversion/config im tunnels-Paragraphen eintragen.
Beispiel:
[tunnels]
ssh = C:/Programme/TortoiseSVN/bin/TortoisePlink.exe

Achtung!!! Bei dem Pfad müssen normale Schrägstriche (/) verwendet werden, also keine Backslashe (\).

Damit bei einer svn+ssh URL ein anderer Benutzer als der aktuelle Windows-Benutzer verwendet wird, muss man nur eine Session in Putty speichern, welche genau den Namen des Hosts der URL trägt. Also bei der URL svn+ssh://svn.example.com/TestRepo/trunk muss die Putty-Session svn.example.com heissen.
Als Host für die Putty-Session sollte man natürlich den selben Host verwenden. Den korrekten Benutzer trägt man unter Connection → Data ein. Ausserdem sollte man den dazugehörigen privaten Schlüssel unter Connection → SSH → Auth eintragen.

Subversion server: svn+ssh

Siehe Kapitel 6 im Online-Buch "Version Control with Subversion".
Ausserdem habe ich selbst eine kleine Doku zu Subversion auf Debian geschrieben.

CVS clients: cvs+ssh

english Defining SSH private key to use with CVS
To use CVS with SSH and a private key just define the key file in the CVSROOT, e.g. :ssh;privatekey='C:\Keys\mykey.pkk':user@module.cvs.sourceforge.net:/... (tested with CVSNT).

In WinCVS 1.3 and later you can also define the SSH key for a new working copy in the Checkout Settings by clicking on the dots ("...") beside the CVSROOT string. Enter your normal user password (2x), then you can change the Privatekey property to the full path of your key file. This will generate the corresponding CVSROOT.


Top Start Kontakt