KOINS.Studio - Articles - Инсталляция и настройка программ - PHPStorm - Command line SVN client

Command line SVN client

Attached files:

# File name Size Comment Change
1
Video (*.avi, Audio Video Interleave).   2018-03-30at11-12-04.mp4
14+032+005 bytes / 13.4 MB 2018-03-30 11:14:15 2585 days ihor.shein
  1. If you need SVNClient, can be downloaded SlikSVN
    For Linux execute command: sudo apt-get install subversion
    For Mac you have to install Homebrew. Then install subversions via Homebrew.

  2. If you do not have PuttyGen or  Plink, can be downloaded HERE.
    For Mac install Putty via Homebrew.

  3. Your SVN key should be converted to PuTTY format and decrypted (clean up password field in PuTTYGen before you save the key). Save PRIVATE key.
    For Linux: load key from studio to PuTTYGen. conversions -> Export Open SSH Key.
    For Mac: puttygen [svn key file] -P -o [name for result PPK file] -O private. You will be requested for new passphrase; left it empty.

  4. Execute the following command in command line window (replace file paths and names to yours):
    c:/www/server/putty/plink.exe -P 35469 -l svn -i c:/www/server/putty/key/yuri.popoff@libs.svn.1024.info.ppk libs.svn.1024.info
    If this is the first time you connect to this host (with this name), system should prompt you to add server key to PuTTY key cache. Add it.
    Note that you should run this command with every separate domain name because this is the only way you can add server key to PuTTY cache.

    If everything is ok, you should see result like the following:
    Server refused to allocate pty
    ( success ( 2 2 ( ) ( edit-pipeline svndiff1 absent-entries commit-revprops depth log-revprops atomic-revprops partial-replay inherited-props ephemeral-txnprops file-revs-reverse ) ) )

    Possible bugs: you've forgotten to decrypt your private key.

    For Linux execute next command from the user's name that works with phpStorm: ssh -2 -i '/var/www/key/yuri.popoff@libs.svn.1024.info.ppk' -p 35469 -l 'svn' libs.svn.1024.info

    Possible bugs: incorrect file owner, incorrect access to file. (Owner should have access to read and write, group and others should have none access)

    Execute svn ls to create a catalog.
    The error will be ocurred, something like this: '/var/www/mysql' is not a working copy

  5. Edit your subversion configuration file. It is placed under your user directory. For me, it is placed here:
    C:\Users\yuri\AppData\Roaming\Subversion\config
    For Mac and Linux it is ~/.subversion/config

    Find the following section in this file:
    [tunnels]    
    add the following line in this section (replace file paths and names with yours):
    For Windows: libs=c:/www/server/putty/plink.exe -P 35469 -l svn -i c:/www/server/putty/key/yuri.popoff@libs.svn.1024.info.ppk
    For Linux and for Mac: libs = ssh svn@libs.svn.1024.info -p 35469 -i [svn key file .pub]
    Name that stands on the left of = is the name that you'll use to access this repository (svn+libs:// prefix in the command in the next step). You are free to select arbitrary name for this purpose.

  6. To see if everything is ok, try to execute the following command in your command line window (note 'libs' in svn+libs:// prefix):
    svn ls svn+libs://libs.svn.1024.info/
    If everything is set up correctly, you should see a list of directories in the root of SVN repository.
    The URL you've tried here is the URL that you should use to access this repository in PHPStorm.

    Possible bugs: if SVN gives error Can't create tunnel go to your subversion configuration file and ensure that slashes are direct (not backslash!).

  7. In PHPStorm make sure that link to repository: svn+libs://libs.svn.1024.info/


How to configure svn in a PHPstorm for Linux/Ubuntu:

  1. Open a terminal and perform the next command: touch [Path to keys]/libs.key

  2. Go to studio. Open page Personnel: http://skrinshoter.ru/s/180220/6Y8qgBXC

  3. Copy libs private key: http://skrinshoter.ru/s/180220/j7phLbN6

  4. Paste key to libs.key file.

  5. Perform commands:
    1. chmod 600 [Path to keys]/libs.key

    2. openssl rsa -in [Path to key]/libs.key -out [Path to keys]/libs.pub -passin pass:[Password from libs key: http://skrinshoter.ru/s/180220/AJXl9vAJ]

    3. chmod 600 [Path to keys]/libs.pub

  6. Edit your subversion configuration file. It is placed under your user directory. For me, it is placed here:
    C:\Users\yuri\AppData\Roaming\Subversion\config
    For Mac and Linux it is ~/.subversion/config
    Find the following section in this file:
    [tunnels]
    add the following line in this section (replace file paths and names with yours):
    ssh svn@libs.svn.1024.info -p 35469 -i [Path to keys]/libs.pub

  7. Perform command: ssh svn@libs.svn.1024.info -p 35469 -i [Path to key]/libs.pub

  8. Open PHPStorm.

  9. Open section VCS->Browse VCS Repository->Browser Subversion Repository.

  10. Add repository location: svn+libs://libs.svn.1024.info

Last modification: 18.02.20 17:18