[英]Is there any way to commit changes that I've made to my SVN checkout of trunk to a branch instead?
I just started working on some changes against trunk on an SVN repo, thinking they would be somewhat small. 我刚刚开始在SVN回购上对trunk进行一些更改,认为它们会有点小。 Now, I actually am beginning to realize that I probably should have just started a new branch instead.
现在,我实际上开始意识到我可能应该刚开始一个新的分支。 Rather than making a branch, and then moving each individual piece into it, is there any way to make a new branch and then commit the changes in my working copy to it?
而不是制作一个分支,然后将每个单独的部分移入其中,有没有办法建立一个新的分支,然后将我的工作副本中的更改提交给它?
DO NOT MAKE ANY CHECKOUT 不要做任何结账
I do it with svn 1.6.5, it works without trouble but if you are really paranoid you could do following: 我用svn 1.6.5做它,它没有麻烦但是如果你真的是偏执狂你可以做以下事情:
如何使用svn diff
从当前工作创建补丁,然后创建一个新分支,并使用patch -p0
将补丁应用到分支?
You can directly branch the state of your working copy to a URL with the svn copy
command. 您可以使用
svn copy
命令将工作副本的状态直接分支到URL。 The created branch will include the local modifications. 创建的分支将包括本地修改。
Some gotchas: 一些陷阱:
svn update
before attempting to branch in this way. svn update
。 svn copy
, the working copy will be unchanged. svn copy
,工作副本将保持不变。 It will still point to the trunk.
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.