There are a lot of different SVN clients you can use to connect to and interact with a Subversion server. This video will talk about installing and starting to use the SVN command line tools. We'll look at a Windows and a Mac OSX machine, and show you a few basic tricks like figuring out which version of the tools you have, and where they are installed.
- [Instructor] We've got our Subversion server set up. Now, let's take a look at a few client options for accessing that server. First, we'll talk about using command-line tools. On Windows, if you're using the same workstation you installed the VisualSVN server on, you've already got the SVN command-line tools. Those got installed by default. If they didn't get installed for some reason, or if you want the latest and greatest version of the SVN command-line tools, head over to subversion.apache.org, and grab the newest installer there. I've got a command prompt open.
Let's see where our SVN command-line tools live. I'll type the command where svn. If the svn executable is on the path, this shows me where it is. If you know you have the SVN client installed, but it doesn't show up when you do this, you might have to adjust the path perimeter in your Windows environment variables. To see which version of SVN you have installed, type svn --version. This tells you the client version, but it also tells you a little about the client capabilities.
Like, which protocols it can use. Let's try connecting to our visual SVN server, to make sure we can talk to a server. Switching to the VisualSVN Management console, right click the test Repository we'd made before. Choose the menu option Copy URL to Clipboard. Now we can use that URL with an SVN info command. I typed svn info, and I'll go to the menu, and choose Edit, Paste.
So, now we have svn info and the URL to the repository we want to get information about. I'll press enter, and it tries to authenticate me using my Windows user name. Now, in this case, that's not the user name I want to use. I'll press enter with a blank password, and it will prompt me for a different user name. I can use the user name I set up before, which is julian. I'll press enter, and it asked for the password. Usually, once you've entered a user name and password once, SVN will remember who the last user was that you authenticated as, and it won't prompt you for that user name again.
So, here I've entered julian and my password, and it should remember this on future attempts. When I press enter, I get information about the repository that I looked at. A few troubleshooting tips for you. If you can't connect to the server, make sure it's running. You can do this with Task Manager. If you right click the Windows start, and choose Task Manager, you should be able to scroll down through the processes, and find the VisualSVN service. So, here we know that it's running.
Second, if you know VisualSVN is running, check your firewall settings, to make sure it's allowed through the firewall. So, to check the firewall, let me go to Control Panel. I'll right click again, and choose Control Panel, then System and Security, Allow an app through Windows Firewall, and I can verify here that VisualSVN is allowed through the firewall. Third, if VisualSVN is running, and it's allowed through the firewall, make sure something else isn't using port 443.
Which is the default port for https access. You can do this with Resource Monitor. The easiest way to get to Resource Monitor, is by going to the Performance tab of Task Manager, and clicking Open Resource Monitor. On the Network tab, there's a section for Listening Ports. If I sort this based on Port number, I can go down to 443, and see what's listening on port 443. In this case it's VisualSVN server, so I'm good.
The VisualSVN server also has a couple of quirks you should know about. One, you can't browse the root directory, above the repositories. You have to use a URL for a specific repository, or something inside that repository. And two, you can only use the https protocol to access the server. You can't use the SVN protocol, like you can with other Subversion servers. This is almost never a problem, but it's something to be aware of. As far as the client configuration goes, there should be some sample configuration files in the APPDATA Subversion of your local machine.
These were created when you installed the client. If you don't know where the APPDATA folder is, just use the command prompt like this. Cd %appdata%\Subversion. The Windows client can also use the registry for configuration, but the local config files will override any registry entries you make. We're not going to use those in this course, but if you're curious about how all that works, here's a good URL you can use for reference.
Visualsvn.com/support/svnbook/advanced/confarea. So, that's Windows, now we can look at the Mac OS X client. We already installed the SVN client using the developer tools, so we won't need to go through the install again. But, just like Windows, you can always get the latest and greatest version of the client, using an installer from subversion.apache.org. We can use the same kinds of commands on a Mac, that we did on Windows. To see where the client files are located, use the which command. Which svn, and that tells us that the svn files are installed in the /usr/bin/svn folder.
Note that the command was where on window, but it's which on Mac. That's just a small syntax difference. We can also see the version information, the same way we did with Windows, using the -- version parameter. Svn --version to view information about the test repository we set up on this machine earlier, we can again use the svn info command. Svn info svn:// this is a local server, so I can use localhost.
And then, the repository we created earlier was MacRepo1. I'll press enter, and that gives us information about the repository. Notice that we're using the svn protocol in this example. The Mac server doesn't use http protocol by default, but it does listen for requests using the SVN protocol. However, if you are talking to a server that's using http, you can use an http URL at that command. Finally, if you're looking for the configuration files for the client, on a Mac, they're in the .subversion folder of your user directory.
This is a hidden folder, so you won't see it in Finder automatically. The easiest way to get to it, is from the Terminal. You can either switch to that folder directly, and access it with Terminal commands by cd ~ for your user home directory /.subversion, and then you can see the files inside that folder with ls -a. Or you can use the open command to open that folder in Finder. Open ~/.subversion.
And from there, you can view and edit the configuration files in any way you want.
- Trunks, tags, and branches
- Checkout, commits, and revisions
- Merging, locking, and working with a team
- TortoiseSVN on Windows
- SVN integration with Eclipse
- Connecting to a project
- Creating a new Java project in Eclipse
- Connecting to an existing Java project using Eclipse
- Dealing with projects that move to a new location
- Making changes and creating branches
- Tracking changes and dealing with conflicts
- Creating a release