简体   繁体   English

将现有Eclipse项目与现有SVN存储库相关联

[英]Associating existing Eclipse project with existing SVN repository

I have an eclipse project on my hard disk, which is a fairly recent check out from an SVN repository. 我的硬盘上有一个eclipse项目,这是最近从SVN存储库中检出的。 I've imported this project into my Eclipse workspace, and now want to associate it with the SVN repository. 我已将此项目导入Eclipse工作区,现在想将其与SVN存储库关联。

How do I do this? 我该怎么做呢? The only options I seem to have under Right-click -> Team is "Share Project", which only seems to allow me to do an initial import. 右键单击 - >团队下我似乎唯一的选项是“共享项目”,这似乎只允许我进行初始导入。

Edit: Motivation - It's a largish repository, and I don't really want to have to import the whole thing over the network. 编辑:动机 - 这是一个较大的存储库,我真的不想通过网络导入整个东西。

Edit 2: There are (for some reason) no .svn dirs in the project. 编辑2:项目中有(出于某种原因)没有.svn dirs。 So maybe a fresh import from svn is the only option 所以也许从svn重新导入是唯一的选择

Team->Share project is exactly what you need to do. Team->Share project正是您需要做的。 Select SVN from the list, then click "Next" . 从列表中选择SVN ,然后单击“下一步” Subclipse will notice the presence of .svn directories that will ask you to confirm that the information is correct, and associate the project with subclipse . Subclipse会注意到存在.svn目录会要求您确认信息是否正确,并将项目与subclipse相关联。

I just wanted to add that if you don't see Team -> Share project, it's likely you have to remove the project from the workspace before importing it back in. This is what happened to me, and I had to remove and readd it to the workspace for it to fix itself. 我只是想补充一点,如果你没有看到团队 - >共享项目,你可能需要先从工作区中删除项目,然后再将其导入。这就是我发生的事情,我不得不删除并读取它到工作区,以便自我修复。 (This happened when moving from dramatically different Eclipse versions + plugins using the same workspace.) (当使用相同的工作空间从显着不同的Eclipse版本+插件移动时发生这种情况。)

subclipse not showing "share project" option on project context menu in eclipse subclipse在eclipse中的项目上下文菜单中没有显示“share project”选项

I came across the same issue. 我遇到了同样的问题。 I checked out using Tortoise client and then tried to import the projects in Eclipse using import wizard. 我使用Tortoise客户端检查,然后尝试使用导入向导在Eclipse中导入项目。 Eclipse did not recognize the svn location. Eclipse无法识别svn位置。 I tried share option as mentioned in the above posts and it tried to commit these projects into SVN. 我试过上面帖子中提到的共享选项,并试图将这些项目提交到SVN。 But my issue was a version mismatch. 但我的问题是版本不匹配。 I selected svn 1.8 version in eclipse (I was using 1.7 in eclipse and 1.8.8 in tortoise) and then re imported the projects. 我在eclipse中选择了svn 1.8版本(我在eclipse中使用1.7,在乌龟中使用1.8.8)然后重新导入项目。 It resolved with no issues. 它解决了没有问题。

I am using Tortoise SVN client. 我正在使用Tortoise SVN客户端。 You can alternativley check out the required project from SVN in some folder. 您可以在某个文件夹中查看SVN所需的项目。 You can see a .SVN folder inside the project. 您可以在项目中看到.SVN文件夹。 Copy the .SVN folder into the workspace folder. 将.SVN文件夹复制到工作区文件夹中。 Now remove the project from eclipse and import the same again into eclipse. 现在从eclipse中删除项目并再次将其导入eclipse。 You can see now the project is now associated with svn 您现在可以看到该项目现在与svn相关联

I'm asked this question very frequently, if it's smart to use "Share project..." if a eclipse project has been disconnected from it SVN counterpart in the repository. 我经常被问到这个问题,如果eclipse项目与存储库中的SVN对象断开连接,那么使用“共享项目......”是明智的。 So, I append my answer to this thread. 所以,我在这个帖子中附上我的答案。

The SVN-Team option "Share project ..." is totally fine for projects that exist in SVN and in your Eclipse workspace, even if the Eclipse project is missing the hidden .svn configuration. SVN-Team选项“Share project ...”对于存在于SVN和Eclipse工作空间中的项目来说完全没问题,即使Eclipse项目缺少隐藏的.svn配置也是如此。 You can still connect them. 你仍然可以连接它们。 Eclipse SVN-implementation (Subclipse/Subversive) will verify if the provided SVN http(s) source is populated. Eclipse SVN实现(Subclipse / Subversive)将验证是否填充了提供的SVN http(s)源。 If yes, all existing files will be copied and linked (checked out in SVN terms) to your very personal Eclipse workspace. 如果是,则将所有现有文件复制并链接(以SVN术语检出)到您个人的Eclipse工作区。

Word of caution: 提醒:

  • Do a backup if you depend on you local files. 如果您依赖本地文件,请进行备份。 The SVN implementation may vary its behaviour with every release. SVN实现可能会随每个版本而改变其行为。
  • If you have multiple projects encapsulated within each other, make sure you point the SVN path to the correct local path. 如果您将多个项目封装在一起,请确保将SVN路径指向正确的本地路径。

regards, Feder 问候,费德

In case of SVN servers you have to creating a central repository with all projects. 对于SVN服务器,您必须创建包含所有项目的中央存储库。 The contents of the repository can be uploaded with the Team/Share command; 可以使用Team / Share命令上载存储库的内容; in case of the Subversive client it automatically runs a commit after the import, so you can upload your files. 如果是Subversive客户端,它会在导入后自动运行提交,因此您可以上传文件。

This step cannot be circumvented in any way using a centralized version management system such as SVN. 使用诸如SVN的集中式版本管理系统不能以任何方式规避该步骤。

Try this- Close the project then open it. 试试这个 - 关闭项目然后打开它。 It links with svn automatically,if project was checked out from valid svn path. 如果项目是从有效的svn路径签出的,它会自动与svn链接。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM