Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

I am investigating a way to commit all modified/added files via the command line with Subversion, excluding a provided black list. Is this possible?

If I have, say, 100 files I would like to commit, but interspersed with that list are seven files that I don't want to commit. Is there a way to say "commit all files excluding /path/to/file1.php, /path/to/file2.php, /path/to/file3.php", etc....

For example, I would have to do something like:

svn ci [list all files to commit in here] -m 'my commit message'

However, is there a better way to do it? I can't find anything documented regarding it.

like image 368
crmpicco Avatar asked Oct 30 '12 16:10

crmpicco


People also ask

How do I commit all files in svn?

svn list <URL> Lists all the files available in the given URL in the repository without downloading a working copy. svn add <filename> Use this command to add new files or changed files to the commit list. svn commit m “Commit message” Commit the added files using a commit message for better traceability.

How do I commit a svn file in Terminal?

Select any file and/or folders you want to commit, then TortoiseSVN → Commit.... The commit dialog will show you every changed file, including added, deleted and unversioned files. If you don't want a changed file to be committed, just uncheck that file.

What is the use of svn commit command?

svn commit will send any lock tokens that it finds and will release locks on all PATH s committed (recursively) unless --no-unlock is passed. If you begin a commit and Subversion launches your editor to compose the commit message, you can still abort without committing your changes.


1 Answers

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.

like image 74
Victor Stanciu Avatar answered Sep 30 '22 17:09

Victor Stanciu