svn delete huge tree but leave modified files
Posted 03-06-2009 at 04:31 PM by ciotog
Tags svn diff kernel perl
In one of our projects at work, the entire kernel source tree was added to an svn repository. I needed a simple way to delete all the files that were unchanged from the original source, and came up with the following:
Confession: yes, I was the one that added the kernel source
Code:
diff -r -s kernel/linux-2.6.12 src/kernel-2.6 | grep identical | perl -e 'while (<>) { ($Files, $fname) = split ; `svn del $fname` };'
Total Comments 0