从 Eclipse 中现有的 Java 项目中删除 SVN
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/11414074/
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
Remove SVN from an existing Java project in Eclipse
提问by Paolo
I have a versioned Java project in Eclipse.
我在 Eclipse 中有一个版本化的 Java 项目。
I decided to remove "SVN" so that when I right-click > Team
on the project, I can only obtain the following choices : Share project ...
and Create patch ...
instead of commit ...
, Update
, etc.
我决定删除“SVN”,所以,当我right-click > Team
的项目,我只能得到以下选择:Share project ...
和Create patch ...
代替commit ...
,Update
等等。
What is the best (cleanest) method to remove version control from a project in Eclipse ?
从 Eclipse 中的项目中删除版本控制的最佳(最干净)方法是什么?
回答by ntalbs
If your project is properly version controlled with SVN, you should be able to see "Synchronize with Repository", "Commit", "Update" under the "Team" menu item of the context menu. In this case, you can use Team > Disconnect
.
如果您的项目使用 SVN 进行了正确的版本控制,您应该能够在上下文菜单的“团队”菜单项下看到“与存储库同步”、“提交”、“更新”。在这种情况下,您可以使用Team > Disconnect
.
If you can't see the menu items like these under Team menu, check that there is .svn
(hidden) directory in your project root.
如果在 Team 菜单下看不到这些菜单项,请检查.svn
项目根目录中是否有(隐藏)目录。
Perhaps you can check out the project again from the repository and use Team > Disconnect
if you haven't changed the code a lot.
也许您可以从存储库中再次检出该项目并使用,Team > Disconnect
如果您没有对代码进行大量更改。
回答by Mihai
Try to recursively delete all .svn folders from your project's root folder. For example, on a Linux machine, you should issue the following command in the project's root folder:
尝试从项目的根文件夹中递归删除所有 .svn 文件夹。例如,在 Linux 机器上,您应该在项目的根文件夹中发出以下命令:
rm -rf `find . -type d -name .svn`
rm -rf`查找。-type d -name .svn`
回答by edmiikk
You only have to remove the top level .svn folder. Then share the project and Eclipse is smart enough to delete all the recursive .svn folders.
您只需删除顶级 .svn 文件夹。然后共享项目,Eclipse 足够智能,可以删除所有递归 .svn 文件夹。
回答by Steve Ham
You can remove the .svn folders in your project by:
您可以通过以下方式删除项目中的 .svn 文件夹:
- Open Terminal
- cd "Your project path"
- find . -type d -name .svn -depth -exec rm -rf {} \;
- 打开终端
- cd“你的项目路径”
- 找 。-type d -name .svn -depth -exec rm -rf {} \;
回答by soneya
An easy solution :
一个简单的解决方案:
Find the .svn
folder in your project directory. It is a hidden folder so find it from File-> show hidden folder
. Then delete it .
.svn
在您的项目目录中找到该文件夹。它是一个隐藏文件夹,因此请从File-> show hidden folder
. 然后删除它。
回答by dosakiller
One good approach to export the SVN project from the repository instead of a checkout which will not have the .svn folders, the local workspace can then be used for updating into a different branch or repository with a similar folder structure.
从存储库导出 SVN 项目而不是没有 .svn 文件夹的检出的一种好方法,然后可以使用本地工作区更新到具有类似文件夹结构的不同分支或存储库。
svn export [-r REV] URL[@PEGREV] [PATH]
Eg : http://svnbook.red-bean.com/en/1.7/svn.ref.svn.c.export.html
http://svnbook.red-bean.com/en/1.7/svn.ref.svn.c.export.html
http://svnbook.red-bean.com/en/1.7/svn.ref.svn.c.export.html