DZone Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world

Snippets has posted 5883 posts at DZone. View Full User Profile

Exclude Certain Files From An SVN Commit

05.22.2007
| 9626 views |
  • submit to reddit
        
svn st | grep M | egrep -v routes | awk -F' ' '{ print $2}' | xargs svn ci -m "blah"

# where egrep -v routes is replaced with all the crap you don't wanna commit

ie - egrep -v routes | egrep -v this | egrep -v that

# I can write a script that takes those expressions as command-line options to make it easier if you're interested.. or we can write it together.. we can do it in ruby!
    

Comments

Snippets Manager replied on Tue, 2007/06/05 - 10:43am

One bug I noticed with this snippet is that the first grep should only look for the M at the beginning of the line: svn st | grep "^M" | ... It should also be clarified that this only commit modified files (and not modified, deleted, etc.)