Here are a few tips on using Subversion with NetBeans. In my case the Subversion was setup on a system that with ssh tunnel, so we'll go over authentication settings as well. My development environment is Mac OS X 10.5.8 with NetBeans 6.8. The remote system is running Solaris 10 x64.



1. We'll start with SSH related details to enable permission to the ssh server. First, let's create a PKI key-pair and then upload the public key tothe remote svn server. You can follow this instructions, and here is the output on Mac:


marina1s-macbook-pro-2:~ userx$ ssh-keygen -t rsa Generating public/private rsa key pair. Enter file in which to save the key(/Users/userx/.ssh/id_rsa): Enter passphrase (empty for nopassphrase): Enter same passphrase again: Your identification has been saved in/Users/userx/.ssh/id_rsa. Your public key has been saved in/Users/userx/.ssh/id_rsa.pub. The key fingerprint is: 42:d0:f4:86:ad:0a:8e:a3:f7:ae:5e:c0:2e:ab:cb:03use rx@marina1s-macbook-pro-2.local The key's randomart image is:


2. Now copy the public key of thegenerated pair to the remote location:

scp .ssh/id_rsa.pub user@server: You can check the success of thisoperation by validating the files on the remote system.

3. In the NetBeans, select your project and in the right-mouse-clickdrop down menu select Versioning ? Subversion. You will then beprompted to enter details of the Subverion repository URL, i.e. svn+ssh url, and the account info for the SSH tunnel. Enter the corresponding values such as:


svn+ssh://hostIP/export/home/myaccount/svnroot ssh -l svnuser -i /Users/userx/.ssh/id_rsa
4. Locale Error

After passing credentials, and submitting the Next button you may run into this erro. With NetBeans IDE, there is a limitation (or a bug) that relates to the Subversion Locale error:

cannot set LC_CTYPE locale
environment variable LANG is en_US.UTF-8
please check that your locale name is correct

After I tried a few workarounds mentioned online and the error message still persisted, I manually installed the latest version of Subversion 1.6 from here and changed the PATH as the default location of the Subversion library is under /usr/bin. You can change the PATH within the NetBeans IDE by navigating to NetBeans -> Preferences (Options for other OSs), selecting Miscellaneous, and Versioning.






You may also check Manage Connection Settings that should capture your url and account settings that you specified in the previous step.


5. Now you should be able to proceed with repository creation, checking in and out your source code. You can find more details on using Subversion with NetBeeans from this article.







More...