NetBeans, SVN, SSH and multiple repositories

I know git is right choice for VCS, but… not all have converted yet and NetBeans does not support git (yet, since work is in progress?).

If You are still stuck in SVN world – in NetBeans FAQ You can find guide how to setup svn+ssh protocol to work with NetBeans.

On Windows (as always) are some gotchas when You setup svn+ssh.

First, connect to host with PuTTy to populate PuTTys key cache – otherwise You won’t be able use command line SVN tools.

Second – don’t dare to set default IP address in PuTTy (that is default host name for Default Settings). If You do, no matter what URL You give as SVN repo address, plink.exe will try connect to default IP/hostname instead to SVN repo. Probably this is not what You want plink to do.

All is working and You need to setup another repository?

As a freelancer I do work with different customers and if more than one uses svn+ssh URL schema, how to setup NetBeans?

Well it can be achieved with little trick. You need to create new schema named for example svn+ssh2 and adjust SVN config.

Example! Example!

Let’s assume we have:

  • first repository
    • URL: svn+ssh://example.com/repo/trunk
    • user: user1
    • password: pwd1
  • second repository
    • URL: svn+ssh://other.example.com/repo/trunk
    • user: user2
    • password: pwd2

    Now [tunnels] section of SVN config file could be:

    [tunnels]
    ssh = plink -l user1 -pw pwd1
    ssh2 = plink -l user2 -pw pwd2
    

    First URL does not change, so we can checkout code with svn+ssh://example.com/repo/trunk, and code from second repository with modified URL: svn+ssh2://other.example.com/repo/trunk (spot this little 2 in protocol name).

    It just works. Or I missed some other option and it can be done simpler way?


Comments

6 responses to “NetBeans, SVN, SSH and multiple repositories”

  1. nice comment.

    though poping up plink windows are annoying.

  2. thank you for this tip.

    @vlad: there is a tortoiseplink.exe which is part of the TortoiseSVN -> http://tortoisesvn.tigris.org/
    tortoiseplink does not have this annoying window…

  3. the second tip (don?t dare to set default IP address in PuTTy) saved my life. I was trying to find out from where TortoiseSVN gets the IP to TortoisePlink for 2 days.

    Thank you.

  4. @Ricardo
    O yeah, this ‘feature’ also took away a lot of time from my life :)

  5. […] Netbeans, SVN, SSH and multiple repositories : Witold … […]

  6. […] wrong [15:26:42] <kurotenshi> i don't know if this is outdated, since NB got alot of love : https://nhw.pl/wp/2008/11/15/netbeans-svn-ssh-and-multiple-repositories [15:32:38] <julsorio> @kurotenshi I have cleaned all the svn connections history but one […]

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.