Partial Commits with Subversion

前端 未结 11 1133
北恋
北恋 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条回答
  •  猫巷女王i
    2020-11-29 18:10

    I use either a local darcs repo, or just merge the changes in gradually. With merging (opendiff opens FileMerge, a merge program that comes with Xcode; replace with your favorite merge tool):

    cp file file.new
    svn revert file
    opendiff file.new file -merge file
    

    merge the related changes, save the merge, quit the merge program

    svn ci -m 'first hunk' file
    mv file.new file
    svn ci -m 'second hunk' file
    

    if more than one unrelated hunk in the file, rinse and repeat (but why would you wait so long before committing?!)

    Also, if you know git, you can use git-svn to maintain a local git repo and sync your commits to an svn master server; works great in my limited experience.

提交回复
热议问题