Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<h2>Subversion does not have a built-in "do not commit" / "ignore on commit" feature, as of February 2016 / version 1.9. This answer is a non-ideal command-line workaround</h2> <p>As the OP states, TortoiseSVN has a built in changelist, "ignore-on-commit", which is automatically excluded from commits. <strong>The command-line client does not have this, so you need to use multiple changelists to accomplish this same behavior (with caveats)</strong>:</p> <ul> <li>one for work you want to commit [work]</li> <li>one for things you want to ignore [ignore-on-commit]</li> </ul> <p>Since there's precedent with TortoiseSVN, I use "ignore-on-commit" in my examples for the files I don't want to commit. I'll use "work" for the files I do, but you could pick any name you wanted.</p> <p>First, add all files to a changelist named "work". This must be run from the root of your working copy:</p> <pre><code>svn cl work . -R </code></pre> <p>This will add all files in the working copy recursively to the changelist named "work". There is a disadvantage to this - as new files are added to the working copy, you'll need to specifically add the new files or they won't be included. Second, if you have to run this again you'll then need to re-add all of your "ignore-on-commit" files again. Not ideal - you could start maintaining your own 'ignore' list in a file as others have done.</p> <p>Then, for the files you want to exclude:</p> <pre><code>svn cl ignore-on-commit path\to\file-to-ignore </code></pre> <p>Because files can only be in one changelist, running this addition after your previous "work" add will remove the file you want to ignore from the "work" changelist and put it in the "ignore-on-commit" changelist.</p> <p>When you're ready to commit your modified files you do wish to commit, you'd then simply add "--cl work" to your commit:</p> <pre><code>svn commit --cl work -m "message" </code></pre> <p>Here's what a simple example looks like on my machine:</p> <pre><code>D:\workspace\trunk&gt;svn cl work . -R Skipped '.' Skipped 'src' Skipped 'src\conf' A [work] src\conf\db.properties Skipped 'src\java' Skipped 'src\java\com' Skipped 'src\java\com\corp' Skipped 'src\java\com\corp\sample' A [work] src\java\com\corp\sample\Main.java Skipped 'src\java\com\corp\sample\controller' A [work] src\java\com\corp\sample\controller\Controller.java Skipped 'src\java\com\corp\sample\model' A [work] src\java\com\corp\sample\model\Model.java Skipped 'src\java\com\corp\sample\view' A [work] src\java\com\corp\sample\view\View.java Skipped 'src\resource' A [work] src\resource\icon.ico Skipped 'src\test' D:\workspace\trunk&gt;svn cl ignore-on-commit src\conf\db.properties D [work] src\conf\db.properties A [ignore-on-commit] src\conf\db.properties D:\workspace\trunk&gt;svn status --- Changelist 'work': src\java\com\corp\sample\Main.java src\java\com\corp\sample\controller\Controller.java src\java\com\corp\sample\model\Model.java M src\java\com\corp\sample\view\View.java src\resource\icon.ico --- Changelist 'ignore-on-commit': M src\conf\db.properties D:\workspace\trunk&gt;svn commit --cl work -m "fixed refresh issue" Sending src\java\com\corp\sample\view\View.java Transmitting file data .done Committing transaction... Committed revision 9. </code></pre> <p>An alternative would be to simply add every file you wish to commit to a 'work' changelist, and not even maintain an ignore list, but this is a lot of work, too. Really, the only simple, ideal solution is if/when this gets implemented in SVN itself. There's a longstanding issue about this in the Subversion issue tracker, <a href="https://issues.apache.org/jira/browse/SVN-2858" rel="noreferrer">SVN-2858</a>, in the event this changes in the future.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload