Temporarily put away uncommitted changes in Subversion (a la “git-stash”)

前端 未结 16 1729
轮回少年
轮回少年 2020-11-28 17:18

While programming software stored in a Subversion repo, I often modify some files, then notice that I\'d like to do some preparatory change for my main work. E.g. while impl

16条回答
  •  春和景丽
    2020-11-28 17:50

    The easiest way would be to use a temporary branch, like this:

    $ svn copy ^/trunk ^/branches/tempbranch
    $ svn switch ^/branches/tempbranch
    $ svn commit -m "Stashed"
    $ svn switch ^/trunk
    $ ... hack away in trunk ...
    $ svn commit -m "..."
    $ svn merge ^/branches/tempbranch .
    $ svn rm ^/branches/tempbranch
    $ ... continue hacking
    

    This could (and probably should) be put in a script if done on a more regular basis.

提交回复
热议问题