7

Possible Duplicate:
partial commits with subversion

Is there any way I can commit only some of the changes in a file to SVN? Let's say I'm working on 2 new features (or bug fixes), and they both affect the same file. I finish 1 feature, and I want to commit just one of the changes. I realize I could create a separate branch for each feature, but this makes things complicated in other ways, constantly switching back and forth between the several feature branches I may be working on at the same time.

Currently when I need to do this, I make a copy of the file, remove the changes I don't want to commit, and then commit that. Then I take the copy and put it back over the stuff I just committed, leaving only the changes I didn't want to commit. This is quite a lot of stuff to do just to possibly commit maybe 1 line for a small bug fix.

I know some might say, you shouldn't do this, because the whole point of committing a whole file is that you are aware exactly what you are committing, and that it won't break the code. But since you can commit individual files, this case isn't much different, because you can still forget to commit other files related to the files you are changing, and still cause the code to be broken. Or similarly forgetting to add files that the new feature depends on.

Community
  • 1
  • 1
Kibbee
  • 65,369
  • 27
  • 142
  • 182
  • 1
    I want to close my own question, because it's duplicate of (http://stackoverflow.com/questions/75809/partial-commits-with-subversion). – Kibbee Mar 16 '11 at 16:38

1 Answers1

2

Subversion does not have such feature and I don't believe there are plans to implement it in a near future. If it's an option, you can try other source control tools that have it:

Community
  • 1
  • 1
Álvaro González
  • 142,137
  • 41
  • 261
  • 360
  • Looks like Tortoise SVN supports it though... http://tortoisesvn.net/docs/release/TortoiseSVN_en/tsvn-dug-commit.html#tsvn-dug-commit-restore – moloko Jan 30 '14 at 12:59
  • Added in Tortoise SVN v1.8 apparently: http://tortoisesvn.net/tsvn_1.8_releasenotes.html#commitparts – moloko Jan 30 '14 at 13:09