LinuxQuestions.org
Register a domain and help support LQ
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices

Reply
 
LinkBack Search this Thread
Old 02-12-2008, 11:04 AM   #1
erinspice
LQ Newbie
 
Registered: Feb 2008
Posts: 7

Rep: Reputation: 0
copy svn working dir without svn hidden dirs and files?


I'm using svn to work on a JSP app which must be compiled and zipped into a fairly large .war file before deployment. I would like to be able to do this without having all the .svn directories and hidden files put into the archive as well. How can I just make a copy of my svn working directory (/home/user/progname) that doesn't include all svn's hidden files?
 
Old 02-12-2008, 05:45 PM   #2
AdaHacker
Member
 
Registered: Oct 2001
Location: Brockport, NY
Distribution: Kubuntu
Posts: 384

Rep: Reputation: 30
You could use the old "copy with tar" trick and pass it the --exclude option. The command would go something like this:
Code:
tar --exclude='.svn' -c -f - /path/to/sourcedir/* | (cd /path/to/destdir ; tar xfp -)
This command builds a tar archive of the files in sourcedir, excluding anything that matches the pattern '.svn' (i.e. the hidden Subversion directories). It writes the command to standard output, changes directory to destdir, and then extracts that standard output from a tar archive back to the filesystem.

Or, if you're too lazy for a command that complicated, you can just copy the entire directory and then delete the Subversion stuff with a plain-old:
Code:
find /path/to/destdir -name '.svn' -exec rm -r {} \;
 
Old 02-12-2008, 06:20 PM   #3
gilead
Senior Member
 
Registered: Dec 2005
Location: Brisbane, Australia
Distribution: Slackware64 14.0
Posts: 4,123

Rep: Reputation: 151Reputation: 151
I haven't been using subversion, so I'm just assuming that export works the same way as it does under CVS. That is, it's like a checkout except it doesn't use create all of the .svn directories. There's some info about svn export here
 
Old 02-12-2008, 08:55 PM   #4
DeuceNegative
LQ Newbie
 
Registered: May 2006
Location: Boston, MA
Distribution: Gentoo
Posts: 29

Rep: Reputation: 16
rysnc is a very powerful alternative to cp. It provides basic things like you want here, progress meters, copying to remote sites, a diff algorithm to efficiently maintain mirrors, compression, etc.

I think you want something like this:

Code:
rsync -r --exclude=.svn /home/user/progname/ /home/user/progname.copy
I almost always use -a (archive) instead of -r (recursive) because it means -r and more (see the man page). The trailing / on progname means `contents of' (otherwise progname.copy will contain progname and everything will be one more level down). Put a trailing / on .svn to only exlude directories with that name, instead of both directories and files with that name, if for some reason you had files named .svn that you wanted to keep in the copy.

rsync is awesome
 
1 members found this post helpful.
Old 03-29-2011, 05:58 PM   #5
nerkn
LQ Newbie
 
Registered: Mar 2011
Posts: 1

Rep: Reputation: 0
Thumbs up

rsync is wonderful, thank you DeuceNegative
 
  


Reply

Tags
subversion, svn


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
anon svn read-only over apache: '.svn/entries': No such file hedpe Linux - Software 2 04-29-2009 05:31 AM
Creating html files from svn mplayer xml? andrew.46 Slackware 3 12-28-2007 10:57 PM
SVN multiple users accessing same files. DavidDiggs Linux - Server 1 05-08-2007 03:07 PM
bash shell command - delete all .svn dirs DamianS Programming 7 04-28-2007 01:33 PM
Cmd to rm dir thats has files and other dirs psyklops Linux - General 4 04-17-2002 08:12 PM


All times are GMT -5. The time now is 03:27 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration