如何在Subversion中替换分支? [英] How to replace a branch in subversion?

查看:72
本文介绍了如何在Subversion中替换分支?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我直到昨天才使用过分支,所以我不知道该把分支当作树干。因此,我分支了一个子文件夹,这引起了一些副作用,例如意外将主干切换到分支...这导致用子文件夹覆盖了主干,并删除了主干内的所有其他内容=破坏了我的工作副本; /

I'v never used branching till yesterday so I didn't knew that I should make the branch our of the trunk. So I branched a subfolder and this caused some side effects like accidental switching the trunk to branch ... this resulted in overwriting the trunk with the subfolder and deleting everything else inside the trunk = destroying my working copy ;/

现在,我想用我的工作副本覆盖这个有问题的分支。如何执行?我正在使用Tortoise SVN。

Now I'm in the situation that I want to override this problematic branch with my working copy. How can this be performed? I'm using Tortoise SVN.

推荐答案

通过命令行很容易实现:

您可以切换工作方式使用本地存储区中的 svn开关TrunkURL 复制回主干。

使用 svn删除URL 删除分支,然后可以使用正确的源重新创建分支。使用 svn开关branchURL ,您可以将本地副本切换到新创建的分支。

Use svn remove URL to remove the branch, you then can recreate the branch with the right source. With svn switch branchURL you can switch your local copy to the newly created branch.

使用TortoiseSVN:


  • 右键单击您的仓库,进入Tortoise菜单并选择 Switch 。选择您的中继,然后将您的本地存储回中继。

  • 进入Tortoise SVN Repo浏览器,找到您的分支。右键单击并将其删除

  • 通过右键单击您的中继并选择复制到...
  • $重新创建分支b $ b
  • 从第一点开始使用 switch 命令切换本地存储库。这次,只需选择分支而不是主干即可。

  • Rightclick on your repo, go into the Tortoise-menu and select Switch. Select your trunk, you will then have your local repo back to trunk.
  • Go into the Tortoise SVN Repo browser, there locate your branch. Right click on it and remove it
  • Recreate the branch by rightclicking your trunk and selecting Copy to...
  • Switch your local repo with the switch command from the first point. This time just select the branch instead of trunk.

不用担心,您不会丢失任何存储在SVN中的文件。甚至您的第一个分支实验也将以一定的修订版本停留在这里。

No worries, you won't lose any files stored in the SVN. Even your first branching-experiment will stay in there at a certain Revision.

这篇关于如何在Subversion中替换分支?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆