带有Subclipse的Eclipse项目:介绍主干和分支 [英] Eclipse project with Subclipse: Introduce trunk and branches

查看:96
本文介绍了带有Subclipse的Eclipse项目:介绍主干和分支的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的工作区中有一个项目(没有主干和分支),需要创建当前版本的副本,以便在使用新功能时为该版本提供错误修复,如下所述: http://nedbatchelder.com/text/quicksvnbranch.html 。在不影响存储库的主要结构和其他开发人员的计算机上已签出项目的情况下,建议的这样做方法是什么?

I have a project in my workspace (without trunk and branches) and need to create a copy of the current release for providing bug fixes for this release while working on a new feature, as described here: http://nedbatchelder.com/text/quicksvnbranch.html. What is the recommended way of doing this without affecting repository's main structure and the checked out projects on the machines of other developers?

推荐答案

如果您在创建存储库时未建立某些结构,那么现在就不能这样做,而不会影响现有用户。存储库就像一个文件系统。您现在可以创建结构,但是由于它涉及到移动项目的存储位置,因此将需要用户从新位置签出,或使用switch选项更新其现有签出以指向新位置。

If you did not establish some structure when you created your repository you cannot do so now without having some impact on existing users. The repository is like a file system. You can create the structure now, but because it will involve moving around where your project is stored it will require users to either checkout from the new location, or use the switch option to update their existing checkout to point at the new location.

您如何做?

1)使用svn mkdir在存储库中创建主干和分支文件夹。您可以使用创建文件夹选项从SVN存储库视图的Subclipse中执行此操作。

1) Use svn mkdir to create the trunk and branches folder in the repository. You can do this from Subclipse from the SVN Repositories view using the Create Folder option.

2)然后,您需要移动根目录下的所有文件和文件夹。仓库到主干文件夹,因此主干现在是项目的根目录。我将使用命令行执行此操作:

2) You then need to move any files and folders that are in the root of your repository to the trunk folder, so that trunk is now the root of your project. I would do this using the command line:

$ svn mv url://host/repos/folder1 url://host/repos/trunk -m "Move folder1 to trunk"

$ svn mv url://host/repos/folder2 url://host/repos/trunk -m "Move folder2 to trunk"

$ svn mv url://host/repos/file1 url://host/repos/trunk -m "Move file1 to trunk"

完成后,存储库显示的根目录现在仅包含主干和分支文件夹。

When you are done, the root of your repository show now only contain the trunk and branches folders.

3)在Eclipse中现有的已签出项目中,执行团队>切换。使用浏览按钮在对话框中选择中继文件夹,然后单击确定。这将更新您的工作副本,使其指向新位置。

3) On your existing checked out project in Eclipse, do Team > Switch. Use the browse button to select the trunk folder in the dialog and click OK. This will update your working copy in place so that it points at the new location.

所有用户都需要执行步骤3。

All users will need to do step 3.

最后,您现在可以创建分支了。只需将trunk复制到branchs文件夹即可创建一个分支。您可以在Eclipse中使用团队>创建分支

Finally, you are now ready to create branches. Just copy trunk to the branches folder to create a branch. You can do this from Eclipse with Team > Create Branch

使用团队>开关在分支和主干之间来回切换。

Use Team > Switch to switch back and forth between your branches and trunk.

使用团队>合并将更改从主干合并到分支,反之亦然。

Use Team > Merge to merge changes from trunk to a branch or vice versa.

这篇关于带有Subclipse的Eclipse项目:介绍主干和分支的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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