使用 subversion 将更改提交到与当前签出分支不同的分支
我一直在处理从开发线检出的代码,发现所做的更改可能是破坏性更改,需要在提交到主开发树之前移动到实验分支。但是,我没有签出实验分支,并且我不想丢失已经进行的更改。
有没有办法将工作文件夹中的更改提交到与最初签出的分支不同的分支?
I've been working on code checked out from the development line and discovered that the changes made might be breaking changes and need to be moved to an experimental branch before committing to the main dev tree. However, I don't have the experimental branch checked out and I don't want to lose the changes that have already been made.
Is there a way to commit the changes in the working folder to a different branch than originally checked out?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
您应该首先从已知的
sourceURL
创建一个分支(这将是您在问题中提到的“开发线”):然后,切换到该分支:
并提交您的更改:
You should create a branch from a known
sourceURL
(this would be your 'development line' you mentioned in the question) first:Then, switch to that branch:
And commit your changes:
您可以在 TortoiseSVN 中执行此操作,如下所示:
享受!
You could do it in the TortoiseSVN like that:
Enjoy!
您可以直接从工作目录创建新分支并将工作目录切换到该分支。
命令是
svn copy
和svn switch
You can create a new branch directly from your working directory and switch the working directory to that branch.
The commands are
svn copy
andsvn switch