Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Partial Commits with Subversion

Tags:

git

svn

Given the case I made two independent changes in one file: eg. added a new method and changed another method.

I often don't want to commit both changes as one commit, but as two independent commits.

On a git repository I would use the Interactive Mode of git-add(1) to split the hunk into smaller ones:

 git add --patch 

What's the easiest way to do this with Subversion? (Maybe even using an Eclipse plug-in)

Update:
In The Thing About Git, Ryan calls it: “The Tangled Working Copy Problem.”

like image 897
Benedikt Waldvogel Avatar asked Sep 16 '08 19:09

Benedikt Waldvogel


1 Answers

Tortoise SVN 1.8 now supports this with it's "Restore after commit" feature. This allow you to make edits to a file, with all of the edits being undone after the commit

Per the documentation:

To commit only the parts of the file that relate to one specific issue:

  1. in the commit dialog, right-click on file, choose "restore after commit"
  2. edit the file in e.g. TortoiseMerge: undo the changes that you don't want to commit yet
  3. save the file
  4. commit the file
like image 157
Casebash Avatar answered Oct 07 '22 01:10

Casebash