I'm trying to create a tar file for deployment of some code but I dont want all the .svn files being deployed.
How can I filter these out? They're in multiple directories...
To remove a file from a Subversion repository, change to the directory with its working copy and run the following command: svn delete file… Similarly, to remove a directory and all files that are in it, type: svn delete directory…
The find command returns a list of all the subfolders matching “. svn”, and this is then piped to the rm command to recursively delete the directory. Running rm using the full path will remove the confirmation prompt, and the “rf” arguments will recursively delete any folder contents.
SVN stands for Subversion. So, SVN and Subversion are the same. SVN is used to manage and track changes to code and assets across projects.
tar --exclude=.svn -z -c -v -f mytarball.tar.gz mydir/
If you have a tar version 1.28 or later, try
tar --exclude-vcs
It can be used to backup directories containing:
From the manual:
‘--exclude-vcs’ Exclude files and directories used by following version control systems: ‘CVS’, ‘RCS’, ‘SCCS’, ‘SVN’, ‘Arch’,‘Bazaar’, ‘Mercurial’, and ‘Darcs’.
For some versions of tar, --exclude-vcs
must be the first argument.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With