Commit all modified/added files via the command line with Subversion excluding a provided black list Commit all modified/added files via the command line with Subversion excluding a provided black list unix unix

Commit all modified/added files via the command line with Subversion excluding a provided black list


There is no option to ignore files on-the-fly on commit. However, there are two approaches you can take:

  1. Use the changelists feature. This can help you create filters for the files that you do want to commit and only commit those. As changelists are created on the developer machine, your filters won't impact the general repository. For example, you can add all the files to a changelist using:

    svn changelist to-commit *

    And then remove those that you want to ignore:

    svn changelist --remove /path/to/file1.php

  2. Only svn add the files that you are working on, one by one as soon as you start editing one. Any file that has not been svn added to the repository will be ignored on commit. Of course, this comes with the disadvantage that you will be the only developer that will have those files on his machine.


I had a similar situation where in I had to commit only certain files from a bunch of modified files. I had to update/remove a dependency from a parent and all of its child projects (Maven) and commit the corresponding changes. Here is what I did to create the SVN changelist.

svn cl my-changelist $(svn st | grep '^M' | awk '{print $2}' | grep 'pom.xml')svn commit -m "Updated dependencies" --changelist my-changelist

The first command above creates a changelist with name 'my-changelist' and adds all the modified files with name 'pom.xml' to the list.

The second command commits the changelist (all the files in the list against a single revision number).