Shell zip command that makes an de-subversioned fileset
I wanted to give somebody a zipped chunk of a local copy of an SVN repository without handing them subversion info in the form of all the .svn directories and files that were lurking within.
After a little lazy googling for a preboiled answer to this admittedly trivial task I read the zip man page and came up with
As it happens this is also a quick way to make a version-free copy of a versioned file tree: it's pretty simple to run the command and you can move the copy about the place easily before unzipping it.
You could say that people using SVN are clever enough to know this and indeed to write their own fiendishly complicated scripts to accomplish the same task. But this would not be particularly truthful or helpful.
After a little lazy googling for a preboiled answer to this admittedly trivial task I read the zip man page and came up with
zip -r directory_zipfile directory -x \*.svn/*- The
-roption zips the directory and its contents. Note: you don't need the .zip suffix on directory_zipfile. - The
-xsupplies a pattern to match filenames that should be excluded from the zip. All the SVN info lives in hidden directories that match the pattern I used.
As it happens this is also a quick way to make a version-free copy of a versioned file tree: it's pretty simple to run the command and you can move the copy about the place easily before unzipping it.
You could say that people using SVN are clever enough to know this and indeed to write their own fiendishly complicated scripts to accomplish the same task. But this would not be particularly truthful or helpful.

1 Comments:
Or use svn export.
Post a Comment
<< Home