svntortoisesvnbranchworking-copy

Branch from working copy and include non-versioned files


Sometimes I start making changes to my working copy and realize I want to park them in a branch so I can head in a different direction but still have access to the changes if needed. That's fine, I know how to do that, e.g. https://stackoverflow.com/a/3697657/2704659. However, what I can't figure out is how to get the non-versioned files to be included in the branch. I may have created a few classes that I want as part of the branch. Is that possible somehow?

Here's the branch UI with nowhere to indicate that.

enter image description here


Solution

  • Whenever you're making a branch from a working copy, it will only branch the currently versioned files -- which is by design to avoid including unnecessary build directories/binaries in your repository.

    To add these additional classes, you will just need to move the files to your new branch, perform an svn add on the files at hand, then an svn commit.

    I can definitely see how you could miss the svn add step if you're used to using the SVN commit dialog. I used to do the same thing but then I eventually guided my team to turn that "show non-versioned files" checkbox off so that way the commit log screen isn't cluttered with files I don't care about, and that I'm sure files I'm committing are the files I want to commit. So svn add > svn commit is sort of a two-step verification.