Partial Commits with Subversion

前端 未结 11 1088
北恋
北恋 2020-11-29 17:36

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

11条回答
  •  醉梦人生
    2020-11-29 18:06

    I used to do this:

    • In my editor (I use vim), edit the file so that only one of the changes appear
    • Save the file (but don't quit the editor)
    • Commit the changed file to svn
    • Hit "undo" in the editor enough times for the second set of changes reappear
    • Save the file again
    • Commit the second set of changes.

    This is a simplistic approach that assumes one set of changes is reasonably easy to undo. For more complex situations, I would give up and commit both changes without worrying about it.

    Now that I use git, this is something I hope I'll never have to do again!

提交回复
热议问题