Recently I’ve been doing some clean up of old files and other assorted junk on one of our servers at work. Between figuring out what needs to stay online, what needs to be archived, and what can be trashed, I noticed that several folders were much larger in filesize than they needed to be. Also, it was taking forever to delete folders because they had hundreds of unnecessary files in them. The files in question? Subversion .svn folders.
Subversion (SVN) is a beautiful thing. I love it, and use it daily to manage my projects, both at work and at home. However, to assist in saving your life at times, SVN uses a system of storing information about the files it’s managing in folders labeled “.svn”. Normally, these are hidden files, so most people don’t even notice that they’re there. However, they are there, and if you attempt to copy a folder that’s under SVN version control, you’ll be copying the associated .svn files with it. Not necessarily a bad thing, unless you want to copy that folder to a webserver, or zip it and email some files off to a client.
Those .svn files can sometimes add up to a significant amount of diskspace, and you don’t need to include them. This is where svn export comes in.
Many SVN users are aware of this command, however, judging by the amount of folders I’ve deleted from our servers today that contained .svn info, and zip files I’ve received in the past from clients and other developers I’ve worked with, there are still plenty of SVN users who apparently have never heard of it.
Name
svn export — Export a clean directory tree.
As the description above states, the command svn export exports a clean directory tree from a repository or the local working copy. What this means is that the files you need are exported to a new directory to be uploaded or copied to disk, without including the extra .svn files. Saving you diskspace, and clients calling you back asking “What’s this .svn stuff? Do I need this too?”
It’s not a hard command to learn, or to use. I can’t vouch for Windows users, but if you’re using svnX on a Mac, there’s a button in the Repository window to take care of the export for you. I’m sure that the Windows SVN tools allow you to use it as well. Either way, both platforms can use the command line, and that can be even faster at times.
So, to sum up: svn export - Learn it. Use it. Love it.
Resources:
Comments feed (RSS 2.0) You can skip to the end and leave a response. Pinging is currently not allowed.
Leave a Reply