Getting Started/Build/Windows/subversion: Difference between revisions

    From KDE TechBase
    No edit summary
    m (moved Getting Started/Build/KDE4/Windows/subversion to Getting Started/Build/Windows/subversion: Reorg, we only have KDE4 now so it's redundant)
    (7 intermediate revisions by 4 users not shown)
    Line 1: Line 1:
    {{warning|This page is yet to be reviewed for changes required by the migration to Git.  Information and commands on this page may no longer be valid and should be used with care. Please see the [[Development/Git|KDE Git hub page]] for more details. }}
    This article details how a developer can set up the Subversion command line client <tt>svn</tt> and <tt>PuTTY</tt> on MS Windows to enable write access to the KDE Subversion Repository, using your existing SSH credentials from *nix.
    This article details how a developer can set up the Subversion command line client <tt>svn</tt> and <tt>PuTTY</tt> on MS Windows to enable write access to the KDE Subversion Repository, using your existing SSH credentials from *nix.


    Line 6: Line 8:


    *Put PuTTY in $PATH
    *Put PuTTY in $PATH
    In order for MS Windows to be able to find PuTTY and its related executable files, you need to add their location to your PATH variable.  By default, puTTY will install to C:\Program Files\PuTTY.  To edit your PATH (for Windows >= Win2k), Start -> Control Panel -> System -> Advanced -> Environment Variables -> System Variables -> Path -> Edit.  Add "C:\Program Files\PuTTY;" to the end of the PATH variable value.
    In order for MS Windows to be able to find PuTTY and its related executable files, you need to add their location to your PATH variable.  By default, PuTTY will install to C:\Program Files\PuTTY.  To edit your PATH (for Windows >= Win2k), Start -> Control Panel -> System -> Advanced -> Environment Variables -> System Variables -> Path -> Edit.  Add "C:\Program Files\PuTTY;" to the end of the PATH variable value.


    ==Enable Existing Key==
    ==Enable Existing Key==
    Line 13: Line 15:


    *Load into PuTTY Key Generator
    *Load into PuTTY Key Generator
    In order to use your OpenSSH private key, you must first convert it to a puTTY Private Key (*.ppk).  To do this, Start -> All Programs -> puTTY -> puTTYgen -> Load.  Browse to wherever you saved your private key (id_dsa) and load it.
    In order to use your OpenSSH private key, you must first convert it to a PuTTY Private Key (*.ppk).  To do this, Start -> All Programs -> PuTTY -> PuTTYgen -> Load.  Browse to wherever you saved your private key (id_dsa) and load it.


    *Save Private Key
    *Save Private Key
    Line 26: Line 28:
    *Add Pageant to Startup group
    *Add Pageant to Startup group
    I suggest adding Pageant to the MS Windows Startup group so that it launches every time you start Windows.
    I suggest adding Pageant to the MS Windows Startup group so that it launches every time you start Windows.
    Pageant does not automatically reload keys when it is started. See the Pageant Help, there is a chapter "Making Pageant automatically load keys on startup".


    ==Configure Subversion PuTTY Tunnel==
    ==Configure Subversion PuTTY Tunnel==
    We need to create a new type of tunnel: subversion over puTTY (svn+putty://).
    We need to create a new type of tunnel: subversion over PuTTY (svn+ssh://).
    We call the tunnel ssh for consistency with the Linux world. We could
    just as well call it putty and then use svn+putty everywhere. The default configuration for emerge (kdesettings-example.bat) uses ssh.


    *We create this tunnel in the Subversion configuration file. Open <tt>%appdata%\Subversion\config</tt>
    *We create this tunnel in the Subversion configuration file. Open <tt>%appdata%\Subversion\config</tt>


    *In [Tunnels] section, we create our new tunnel by adding a line:
    *In [Tunnels] section, we create our new tunnel by adding a line (use \\ for backslash):
    <tt>putty = plink -ssh -C -i c:\path\to\id_dsa.ppk -agent <svnaccountname>@svn.kde.org</tt>
    <tt>ssh = plink -ssh -C -i c:\\path\\to\\id_dsa.ppk -agent <svnaccountname>@svn.kde.org</tt>
     
    <tt>plink</tt> is the command line version of PuTTY. <tt>-ssh</tt> tells PuTTY to use SSH protocol. <tt>-C</tt> turns on compression. <tt>-i</tt> is the path to your private key. <tt>-agent</tt> tells PuTTY to try to use Pageant.


    <tt>plink</tt> is the command line version of puTTY. <tt>-ssh</tt> tells puTTY to use SSH protocol. <tt>-C</tt> turns on compression. <tt>-i</tt> is the path to your private key. <tt>-agent</tt> tells puTTY to try to use Pageant.
    As an alternative to editing the Subversion configuration file, you can define the environment variable SVN_SSH just like you would define the ssh tunnel (untested).


    Now open putty (Start -> All Programs -> PuTTY -> PuTTY) and open a connection to <tt>svn.kde.org</tt> it will ask you if you accept the server id. Select yes,
    Now open PuTTY (Start -> All Programs -> PuTTY -> PuTTY) and open a connection to <tt>svn.kde.org</tt> it will ask you if you accept the server id. Select yes,
    a terminal window with an error message will apear, this is normal. The authentication process between your computer and svn.kde.org is now complete.
    a terminal window with an error message may appear, this is normal. If prompted, enter your username. It may then throw errors, but don't worry. The authentication process between your computer and svn.kde.org is now complete, and you may close the PuTTY session.


    ==Repository Access==
    ==Repository Access==
    *The repository can now be accessed by using the svn+putty:// tunnel, e.g. <tt>
    *The repository can now be accessed by using the svn+ssh:// tunnel, e.g. <tt>
    C:\KDE4> svn co svn+putty://svn.kde.org/home/kde/trunk/kdesupport/emerge</tt>
    C:\KDE4> svn co svn+ssh://svn.kde.org/home/kde/trunk/kdesupport/emerge</tt>


    ==Setup Git==
    ==Setup Git==

    Revision as of 10:46, 3 March 2011

    Warning
    This page is yet to be reviewed for changes required by the migration to Git. Information and commands on this page may no longer be valid and should be used with care. Please see the KDE Git hub page for more details.


    This article details how a developer can set up the Subversion command line client svn and PuTTY on MS Windows to enable write access to the KDE Subversion Repository, using your existing SSH credentials from *nix.

    Install PuTTY

    • Install PuTTY

    PuTTY is a free implementation of SSH for Win32. Download and install PuTTY. Using the Windows install file is the easiest method. As of this writing the current version is putty-0.60-installer.exe.

    • Put PuTTY in $PATH

    In order for MS Windows to be able to find PuTTY and its related executable files, you need to add their location to your PATH variable. By default, PuTTY will install to C:\Program Files\PuTTY. To edit your PATH (for Windows >= Win2k), Start -> Control Panel -> System -> Advanced -> Environment Variables -> System Variables -> Path -> Edit. Add "C:\Program Files\PuTTY;" to the end of the PATH variable value.

    Enable Existing Key

    • Transfer existing ~\.ssh\id_dsa to Windows

    Copy the private ssh key that is associated with your KDE Subversion account to the MS Windows machine. In many cases this will be /home/kde-devel/.ssh/id_dsa. I put mine in C:\Documents and Settings\mark\My Documents.

    • Load into PuTTY Key Generator

    In order to use your OpenSSH private key, you must first convert it to a PuTTY Private Key (*.ppk). To do this, Start -> All Programs -> PuTTY -> PuTTYgen -> Load. Browse to wherever you saved your private key (id_dsa) and load it.

    • Save Private Key

    Once the key is loaded, click on 'Save Private Key' to save a copy of the key in a version that PuTTY can use. I saved mine as id_dsa.ppk.

    Enable Pageant

    Pageant is PuTTY's version of sshagent, holding your keys for you so you don't always have to enter your passphrase.

    • Start Pageant

    Start Pageant Start -> All Programs -> PuTTY -> Pageant. An icon will appear in your system tray. Right-click in the icon, then select view keys. If your key isn't listed, click on 'Add Key' and add the id_dsa.ppk key you created earlier.

    • Add Pageant to Startup group

    I suggest adding Pageant to the MS Windows Startup group so that it launches every time you start Windows.

    Pageant does not automatically reload keys when it is started. See the Pageant Help, there is a chapter "Making Pageant automatically load keys on startup".


    Configure Subversion PuTTY Tunnel

    We need to create a new type of tunnel: subversion over PuTTY (svn+ssh://). We call the tunnel ssh for consistency with the Linux world. We could just as well call it putty and then use svn+putty everywhere. The default configuration for emerge (kdesettings-example.bat) uses ssh.

    • We create this tunnel in the Subversion configuration file. Open %appdata%\Subversion\config
    • In [Tunnels] section, we create our new tunnel by adding a line (use \\ for backslash):

    ssh = plink -ssh -C -i c:\\path\\to\\id_dsa.ppk -agent <svnaccountname>@svn.kde.org

    plink is the command line version of PuTTY. -ssh tells PuTTY to use SSH protocol. -C turns on compression. -i is the path to your private key. -agent tells PuTTY to try to use Pageant.

    As an alternative to editing the Subversion configuration file, you can define the environment variable SVN_SSH just like you would define the ssh tunnel (untested).

    Now open PuTTY (Start -> All Programs -> PuTTY -> PuTTY) and open a connection to svn.kde.org it will ask you if you accept the server id. Select yes, a terminal window with an error message may appear, this is normal. If prompted, enter your username. It may then throw errors, but don't worry. The authentication process between your computer and svn.kde.org is now complete, and you may close the PuTTY session.

    Repository Access

    • The repository can now be accessed by using the svn+ssh:// tunnel, e.g.

    C:\KDE4> svn co svn+ssh://svn.kde.org/home/kde/trunk/kdesupport/emerge

    Setup Git

    Install Git by either running 'emerge git' or by downloading the zip yourself from the msysgit page.

    After installation you will need to setup the following environment variables (as shown above):

    • Create a new variable HOME with value %USERPROFILE%. This will be expanded to the path of your account automatically.
    • Create a new variable GIT_SSH with value: plink.exe

    Git is now completely setup to follow the steps in the KDE Git tutorial