Tar with exclusion

Sometimes I want to duplicate a Subversion-ed directory, without the .svn folders in each subdirectory. The reason for this is when I want to add/commit this newly duplicated folder, I get an error message because the .svn directory indicates that the files are already in the repository — when it is NOT.

We can do this easily by using tar and the exclude flag:

$ tar -cvf foo.tar ./* --exclude=.svn
Advertisements

2 thoughts on “Tar with exclusion

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s