你如何让 eclipse 使用现有的 svn 工作副本?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/1156330/
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
How do you make eclipse use an existing svn working copy?
提问by allyourcode
I've got a working copy checked out with svn; furthermore, I've created a new project in Eclipse that has the root of the working copy as the project's location. I want to be able to do stuff like compare versions from Eclipse. I have Subclipse 1.4.8, but that doesn't seem to give me what I want. Am I doing something wrong?
我有一个用 svn 检出的工作副本;此外,我在 Eclipse 中创建了一个新项目,该项目将工作副本的根作为项目的位置。我希望能够做一些事情,比如比较 Eclipse 的版本。我有 Subclipse 1.4.8,但这似乎没有给我我想要的。难道我做错了什么?
回答by whoismanu
i have an svn working copy that also is a project in eclipse. after installing the subclipse plugin i had the same problem, the working copy was not recognized as such.
我有一个 svn 工作副本,它也是 eclipse 中的一个项目。安装 subclipse 插件后,我遇到了同样的问题,无法识别工作副本。
i just managed by chance to get it recognized as an svn working copy by renaming the project in question and then renaming it back to its old name. not very nice, but it did the trick :-)
我只是偶然地通过重命名相关项目然后将其重命名回其旧名称来将其识别为 svn 工作副本。不是很好,但它做到了:-)
回答by sleske
There is an option when creating a new project, to use an existing source directory:
创建新项目时有一个选项可以使用现有的源目录:
New project/ new Java Project / Create project from existing source.
新项目/新 Java 项目/从现有源创建项目。
Use that, tell it where your source lives, and it should automatically detect if it's a SVN working copy.
使用它,告诉它你的源代码在哪里,它应该自动检测它是否是一个 SVN 工作副本。
回答by Saravanan M
I guess this is not possible with Subclipse as it's given in its documentationthat, you can only import an existing svn-managed folder under one condition, according to the doc:
我想这对 Subclipse 来说是不可能的,因为它在其文档中给出,根据文档,您只能在一种条件下导入现有的 svn-managed 文件夹:
"The only requirement is that your working copy has to also be a valid Eclipse project."
“唯一的要求是您的工作副本也必须是有效的 Eclipse 项目。”
So, if you have a working copy that is not a complete eclipse project, Subclipse will not connect it to SVN.
因此,如果您的工作副本不是完整的 eclipse 项目,Subclipse 将不会将其连接到 SVN。
回答by SoltanG
I am answering this after a long time of the question being asked. I ended up here because I was facing the same problem.
在问了很长时间的问题后,我正在回答这个问题。我最终来到这里是因为我面临着同样的问题。
My solution was to create an empty .svn folder at the root folder of the project (in the latest version of svn client tortoise all meta-data is at the root folder). Then did an eclipse refresh and voila it did the trick. I am running subclipse core - 1.8.4.
我的解决方案是在项目的根文件夹中创建一个空的 .svn 文件夹(在最新版本的 svn client tortoise 中,所有元数据都在根文件夹中)。然后做了一次日食刷新,瞧它成功了。我正在运行 subclipse 核心 - 1.8.4。
回答by Couitchy
You can right click on the root node of your project and select: Team / Share project
您可以右键单击项目的根节点并选择:Team / Share project
Then you choose SVN, let the default settings and it should work fine!
然后你选择SVN,使用默认设置,它应该可以正常工作!
回答by Rob Cranfill
One step that seemed to work for me, that no one has explicitly mentioned yet: I closed and then re-opened the project. I tried the "rename" trick, above, and that didn't work, but perhaps the poster of that answer also closed the project - they didn't detail exactly what steps they went thru to rename it. (I found you don'thave to close the project to rename it, but perhaps they did.)
一个似乎对我有用但没有人明确提到过的步骤:我关闭然后重新打开该项目。我尝试了上面的“重命名”技巧,但没有奏效,但也许该答案的海报也关闭了该项目——他们没有详细说明重命名它所经历的具体步骤。(我发现您不必关闭项目来重命名它,但也许他们做到了。)
< /rob>
</抢>
回答by James Jithin
I had the same issue and here are the details of the fix.
我遇到了同样的问题,这里是修复的详细信息。
My Eclipse is "Helios Service Release 1".
我的 Eclipse 是“Helios Service Release 1”。
I had an SVN checkout on my filesystem, I went to New Java Project
, unchecked Use default location
, chose the location, went to next step, chose the source folder and said Finish
.
我的文件系统上有一个 SVN 结帐,我去了New Java Project
,未选中Use default location
,选择了位置,转到下一步,选择了源文件夹并说Finish
.
The project came up with no disk icon on it. As per few forum posts, right-clicked on the project, went to Team
> Share Project
, chose SVN
, clicked Next
, and the option was only to share the files to the SVN Repository for the first time.
该项目上没有磁盘图标。根据几个论坛帖子,右键单击该项目,转到Team
> Share Project
,选择SVN
,单击Next
,该选项仅是第一次将文件共享到 SVN 存储库。
I said Cancel
, and the option is to make changes to the SVN plug-in settings. Went to Window
menu, chose Preferences
, browsed Team
> SVN
. Chose the SVN Connector
tab, changed the SVNKit 1.2.3
to SVNKit 1.3.5
and said OK
.
我说的Cancel
,选项是修改SVN插件设置。进入Window
菜单,选择Preferences
,浏览Team
> SVN
。选择SVN Connector
选项卡,更改SVNKit 1.2.3
为SVNKit 1.3.5
并说OK
。
Then, right clicked on the project, said Team
> SVN
, on the next screen, chose the option Use Project Settings
and clicked Finish
. The disk button came to the project and the SVN URL got displayed on it.
然后,右键单击该项目,说Team
> SVN
,在下一个屏幕上,选择该选项Use Project Settings
并单击Finish
。磁盘按钮出现在项目中,SVN URL 显示在其上。
回答by duhrer
In my case, I couldn't use an existing copy because I checked out the code using a newer version of Subversion on the command-line and Subclipse 1.4 couldn't recognize it. Upgrading and going through the improved "Share Project" menu resolved the problem.
就我而言,我无法使用现有副本,因为我在命令行上使用更新版本的 Subversion 检查了代码,而 Subclipse 1.4 无法识别它。升级并通过改进的“共享项目”菜单解决了该问题。
I got this tip from the forums here:
我从这里的论坛得到了这个提示:
http://subclipse.tigris.org/ds/viewMessage.do?dsForumId=1047&dsMessageId=2380064
http://subclipse.tigris.org/ds/viewMessage.do?dsForumId=1047&dsMessageId=2380064
回答by Mario Ortegón
It will definitively not work if you use a different version of svn to checkout, that the one that is supported by Eclipse. I had this problem as I used svn 1.6 to checkout but I had an older eclipse version that had only 1.5. Subclipse has its own build-in svn client (Actually, in two flavors if I am not mistaken).
如果您使用 Eclipse 支持的不同版本的 svn 进行结账,它肯定不会工作。我在使用 svn 1.6 结账时遇到了这个问题,但我有一个只有 1.5 的旧 eclipse 版本。Subclipse 有自己的内置 svn 客户端(如果我没记错的话,实际上有两种风格)。
Check that the subclipse version matches the svn client that you used to checkout. You can check the plugin version number for subclipse (Help -> About -> Click on subversion logo) and match it against svn --version
检查 subclipse 版本是否与您用于检出的 svn 客户端匹配。您可以检查 subclipse 的插件版本号(帮助 -> 关于 -> 单击 subversion 徽标)并将其与 svn --version 匹配
回答by bkritzer
Add the repository to your list of repositories in subclipse by choosing Window->Show View->Other... and choose SVN->SVN Repositories. Put in all the necessary info to connect to the repository.
通过选择 Window->Show View->Other... 并选择 SVN->SVN Repositories,将存储库添加到 subclipse 中的存储库列表中。输入所有必要的信息以连接到存储库。
Next, right click the repository and choose "checkout". If the project doesn't already have an eclipse .project file, you can create a new project from the source. If it already has a .project file, it will import that .project and use that as your eclipse project locally.
接下来,右键单击存储库并选择“结帐”。如果项目还没有 eclipse .project 文件,您可以从源创建一个新项目。如果它已经有一个 .project 文件,它将导入该 .project 并将其用作本地的 eclipse 项目。