在 Eclipse 中将项目重新连接到 SVN

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/14606888/
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-10 21:31:56  来源:igfitidea点击:

Reconnecting a project to SVN in Eclipse

eclipsesvn

提问by James Harpe

I have a project that has been versioned by SVN for months, but now all of a sudden it seems that Eclipse does not recognize the project as being under version control. In the team menu, I only have Apply Patch... and Share Project...

我有一个项目已经被 SVN 版本控制了几个月,但现在突然间 Eclipse 似乎不承认该项目处于版本控制之下。在团队菜单中,我只有应用补丁...和共享项目...

I tried Share Project as suggested elsewhere, but Eclipse doesn't recognize the project as being under version control.

我按照其他地方的建议尝试了 Share Project,但 Eclipse 无法识别该项目处于版本控制之下。

All the svn dirs exist.

所有 svn 目录都存在。

Interestingly, I tried sharing the project to a different repository and I got an error saying that the project was already a working copy for another URL.

有趣的是,我尝试将项目共享到不同的存储库,但收到错误消息,指出该项目已经是另一个 URL 的工作副本。

Any ideas?

有任何想法吗?

采纳答案by tobias_k

There are a few things that you can try.

您可以尝试一些方法。

  • If the project is in synch with SVN, probably the easiest way is to delete it and check it out anew.
  • Otherwise, you can try to delete the project from your workspace (notfrom disk!) and to re-import it into the workspace.
  • If that does not work, you can try to use the SVN command line tools, e.g. svn commit, to synchronize your local project with the SVN repository (and check it out anew using Eclipse).
  • In case the SVN command line tools do not work, there might to be an actual problem with the SVN files. In this case, you could back up your project (with unsynched changes), check out the project from SVN, and use an offline-diff-tool such as diffor meldto carry the changes over to the newly checked-out project.
  • 如果项目与 SVN 同步,可能最简单的方法是将其删除并重新检查。
  • 否则,您可以尝试从您的工作区(而不是从磁盘!)中删除该项目并将其重新导入到工作区中。
  • 如果这不起作用,您可以尝试使用 SVN 命令行工具,例如svn commit,将本地项目与 SVN 存储库同步(并使用 Eclipse 重新检查)。
  • 如果 SVN 命令行工具不起作用,则 SVN 文件可能存在实际问题。在这种情况下,您可以备份您的项目(带有未同步的更改),从 SVN 检出项目,并使用离线差异工具(例如diffmeld)将更改转移到新检出的项目中。

回答by inigoD

Try following: Rigth click -> Team->'share projectS' (plural, in singular does not work) in your disconnected project

尝试以下操作:在断开连接的项目中右键单击 -> Team->'share projectS'(复数,单数不起作用)

I cannot reproduce it now in my PC but there appears a option to reconnect to svn -or to connect using svn information that exists in project-. (Just do as you were going to put a new project in svn, it will see the svn info and will asks you to use it)

我现在无法在我的 PC 中重现它,但出现了重新连接到 svn 的选项 - 或使用项目中存在的 svn 信息进行连接 -。(就像你要在 svn 中放置一个新项目一样,它会看到 svn 信息并要求你使用它)

I hate that problems....

我讨厌那些问题......

回答by Srivignesh

Team > Share projectworks fine. The disadvantage is SVN supports to share projects one by onerather than many projects at a time.

团队 > 共享项目工作正常。缺点是 SVN 支持一个一个地共享项目而不是一次共享多个项目。

回答by Shouvik Choudhury

4 years too late, but for anyone who faces this problem :

4 年太晚了,但对于任何面临这个问题的人来说:

  • If while disconnecting from SVN, the meta-data was erased :
  • 如果在与 SVN 断开连接时,元数据被删除:

Right click on the project ->

右键单击项目->

Team-> Share Project-> SVN->

团队->共享项目-> SVN->

Use existing repository location -> Next ->

使用现有的存储库位置 -> Next ->

Browse to your project's trunk folder -> OK -> Next ->

浏览到您项目的主干文件夹 -> OK -> Next ->

Here you will get a commit comment box. Just press Finish ->

在这里你会得到一个提交评论框。只需按完成 - >

A warning sign is displayed in a popup window saying "The project xxx already exists in the repository and has some content. Do you wish to proceed?" ->

弹出窗口中会显示一个警告标志,提示“项目 xxx 已存在于存储库中并且有一些内容。您要继续吗?” ->

Click yes ->

单击是 ->

A window will popup showing the progress of prepare commit ->

将弹出一个窗口,显示准备提交的进度 ->

After completion you will get the actual commit window showing all the resources as modified ->

完成后,您将获得实际提交窗口,显示所有已修改的资源 ->

Click CANCELhere ->

点击这里取消->

It will connect your local project to SVN and also will not commit anything.

它会将您的本地项目连接到 SVN,并且不会提交任何内容。

回答by Alex R

I had better luck with the singular version of 'share project'. Had to manually add 'trunk' to the suggested repository path.

我对“共享项目”的单一版本有更好的运气。必须手动将“主干”添加到建议的存储库路径。