如何在工作区中一起使用 SVN 和 Eclipse?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/10722052/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-19 18:14:24  来源:igfitidea点击:

How to use SVN and Eclipse in workspace together?

eclipsesvnversion-controlworkspace

提问by user897029

I wrote a simple app for Android but now I want to put it into version control.

我为 Android 编写了一个简单的应用程序,但现在我想将其放入版本控制中。

So I installed Subclipse but there are two problems:

所以我安装了 Subclipse 但有两个问题:

  1. My project is in [workspace]/MyAppbut I want to move it into [workspace]/MyApp/work/trunk(where workis a SVN working directory)

    I always get the error that I don't must overlap the workspace. I created another workspace and used it with this project - but is that really the best solution?

  2. What about branching? I came from Code::Blocks where you can simply move your project file! In Eclipse it's a bit more complicated I think. Is there a refactor/copy solution available?

  1. 我的项目在[workspace]/MyApp但我想将它移动到[workspace]/MyApp/work/trunk(其中work是一个 SVN 工作目录)

    我总是收到我不必与工作区重叠的错误。我创建了另一个工作区并将它用于这个项目 - 但这真的是最好的解决方案吗?

  2. 分支呢?我来自 Code::Blocks,您可以在其中简单地移动您的项目文件!在 Eclipse 中,我认为它有点复杂。是否有可用的重构/复制解决方案?

采纳答案by Gilbert Le Blanc

1) The normal procedure is that you right click on the Eclipse project, and left click on Team -> Share project. You tell Eclipse where in Subversion you want to store the project. The Eclipse workspace and the Subversion trunk are different directories. Sometimes on different computers.

1) 正常的过程是右键单击Eclipse项目,然后左键单击Team -> Share project。您告诉 Eclipse 您想在 Subversion 中的哪个位置存储项目。Eclipse 工作区和 Subversion 主干是不同的目录。有时在不同的计算机上。

The Eclipse workspace is called the Subversion working copy. You commit changes from the Subversion working copy to the Subversion trunk (or branch) using Team -> Commit. You update changes from the Subversion trunk to the Subversion working copy using Team -> Update.

Eclipse 工作区称为 Subversion 工作副本。您可以使用 Team -> Commit 将更改从 Subversion 工作副本提交到 Subversion 主干(或分支)。您可以使用 Team -> Update 将更改从 Subversion 主干更新到 Subversion 工作副本。

2) To branch in Subversion, you use Subclipse to copy the modules from the trunk to a branch. Then you check out the branch in Eclipse.

2) 要在 Subversion 中创建分支,请使用 Subclipse 将模块从主干复制到分支。然后在 Eclipse 中检查分支。

To move modules in Eclipse, you right click on the module and left click on the Refactor -> Move option.

要在 Eclipse 中移动模块,右键单击模块并左键单击 Refactor -> Move 选项。

To copy modules in Eclipse, you just copy and paste. Copied modules and new modules have to be identified to Subversion using Team -> Add to version control.

要在 Eclipse 中复制模块,您只需复制和粘贴即可。必须使用 Team -> Add to version control 将复制的模块和新模块标识到 Subversion。