UPDATE: NetBeans 7.0 has much better UI for supporting login credentials using SVN over SSH. The instructions below may prove helpful if for some reason you are stuck with NetBeans 6.9.1. however.
I am liking NetBeans as my PHP/WordPress dev IDE, but I ran into some difficulty recently setting it up to use SVN over SSH. Here’s the solution that I was able to hit upon. If there’s an easier way to do this, please let me know in the comments. These instructions apply to Mac OSX. And, as always, ymmv!
Open up the preferences pane and click on Miscellaneous > Versioning > Subversion.
Make sure to define the path to your SVN executable file. This should be
/usr/bin/ on a Mac.
Then click Define Folder > Add with Wizard. Paste the svn+ssh path into the Repository URL, this should be something like:
svn+ssh://10.5.8.111/path/to/repo. Then, for the tunnel command, enter
ssh -l yourusername -q.
NetBeans does not natively support the ability to challenge you for your SSH password as part of its UI, so we need to do a little more work. I found an excellent tip here.
You’ll need this script:
# An SSH_ASKPASS command for MacOS X
# Author: Joseph Mocker, Sun Microsystems
# To use this script:
# setenv SSH_ASKPASS "macos-askpass"
# setenv DISPLAY ":0"
DIALOG="display dialog \"$@\" default answer \"\" with title \"$TITLE\""
DIALOG="$DIALOG with icon caution with hidden answer"
result=`osascript -e 'tell application "Finder"' -e "activate" -e "$DIALOG" -e 'end tell'`
if [ "$result" = "" ]; then
echo "$result" | sed -e 's/^text returned://' -e 's/, button returned:.*$//'
sudo vi /usr/libexec/ssh-askpass
Paste the script, save the file (needs sudo password), make it executable
sudo chmod +x /usr/libexec/ssh-askpass
Now when you try to use Subversion within NetBeans, a dialog box should pop up asking you for your password. It’s not very pretty, but it does the trick!