使用 subversion 将更改提交到与当前签出分支不同的分支

发布于 2024-08-31 05:58:43 字数 128 浏览 4 评论 0原文

我一直在处理从开发线检出的代码,发现所做的更改可能是破坏性更改,需要在提交到主开发树之前移动到实验分支。但是,我没有签出实验分支,并且我不想丢失已经进行的更改。

有没有办法将工作文件夹中的更改提交到与最初签出的分支不同的分支?

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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

赏烟花じ飞满天 2024-09-07 05:58:43

您应该首先从已知的 sourceURL 创建一个分支(这将是您在问题中提到的“开发线”):

svn copy sourceURL branchURL

然后,切换到该分支:

svn switch branchURL

并提交您的更改:

svn commit

You should create a branch from a known sourceURL (this would be your 'development line' you mentioned in the question) first:

svn copy sourceURL branchURL

Then, switch to that branch:

svn switch branchURL

And commit your changes:

svn commit
从﹋此江山别 2024-09-07 05:58:43

您可以在 TortoiseSVN 中执行此操作,如下所示:

  • 右键单击要分支的更改所在的目录。它不能是存储库的根目录,以免以这种方式重复;
  • 选择TortoiseSVN -> “分支/标签...”;
  • 设置到 URL:“svn://host/repository/FooBar/branches/FooBarBranchName”;
  • 确保[*]选择工作副本。这将确保更改得到落实;
  • 日志消息:“用苍蝇进行实验:)”;
  • 可选:勾选 [*] 将工作副本切换到新分支/标签。如果您计划继续在新分支上工作,这非常有用。尽管您也可以稍后切换到它。
  • 尝试找到确定按钮。提示:它位于窗口下部的中心。

享受!

You could do it in the TortoiseSVN like that:

  • Right click on the directory where are the changes you want to branch. It must not be the root of the repository, less to duplicate in that way;
  • Select TortoiseSVN -> "Branch/tag...";
  • Set To URL: "svn://host/repository/FooBar/branches/FooBarBranchName";
  • Make sure [*] Working copy is selected. This will ensure the changes are commited;
  • Log message: "Experimenting with flies :)";
  • Optional: Tick [*] Switch working copy to new branch/tag. This is useful if you are planning to keep working on the new branch. Although you can switch to it later too.
  • Try to find the OK button. Hint: it is in the lower part of the window centred.

Enjoy!

吻风 2024-09-07 05:58:43

您可以直接从工作目录创建新分支并将工作目录切换到该分支。

命令是
svn copysvn 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 and svn switch

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文