如何在 Eclipse 中备份我的 Java 项目?

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

How can I back-up my java project in Eclipse?

javaeclipsebackup

提问by Holly

I'm new to development and I'm sure this is a silly question but i can't work out how i should be backing-up copies of my project. When everything's working right i want to save a copy/make a back-up so that if i ever mess everything up i'll have something i can go back to, but of course it's not as simple as just copying a file like i normally would for anything else. Sorry for the silly query, but if someone could point me in the right direction as to how i should go about this that would be great!

我是开发新手,我确定这是一个愚蠢的问题,但我不知道应该如何备份我的项目副本。当一切正常时,我想保存一份副本/进行备份,这样如果我把一切都搞砸了,我会有一些我可以回去的东西,但当然它不像我通常那样复制文件那么简单会为别的。对不起,愚蠢的查询,但如果有人能指出我应该如何去做的正确方向,那就太好了!

采纳答案by Buhake Sindi

When everything's working right i want to save a copy/make a back-up so that if i ever mess everything up i'll have something i can go back to

当一切正常时,我想保存一份副本/进行备份,这样如果我把一切都搞砸了,我就会有一些我可以回去的东西

A version control system is perfect for you. Eclipse allows to clone your repository into a version control system such as CVS, SVN, Mercurial, Clearcase, Git, etc.

版本控制系统非常适合您。Eclipse 允许将您的存储库克隆到版本控制系统中,例如 CVS、SVN、Mercurial、Clearcase、Git 等。

For me, I use Mercurial(previously using SVN), and its Eclipse plugin can be found on JavaForge.

对我来说,我使用Mercurial(以前使用 SVN),它的 Eclipse 插件可以在JavaForge上找到。

回答by ivy

It's not a silly question. You can back up your project directory (just make a copy, zip, etc) but I would advise you to have a look at version management (cvs, subversion, git, whatever you like). With version management you can go back to any state, create different development branches etc...

这不是一个愚蠢的问题。您可以备份您的项目目录(只需复制、压缩等),但我建议您查看版本管理(cvs、subversion、git,无论您喜欢什么)。通过版本管理,您可以返回任何状态,创建不同的开发分支等...

回答by Bryan Field

I find Mercurialto be very handy.

我发现Mercurial非常方便。

It requires no server, but it still allows for multiple developers on the same project by splitting the program into two different branches of development and merging them together when complete.

它不需要服务器,但通过将程序拆分为两个不同的开发分支并在完成时将它们合并在一起,它仍然允许多个开发人员在同一项目上。

回答by Volker Stolz

Even without resorting to a version management, Eclipse provides a similar feature: in the Preferences, go to General -> Workspace -> Local History

即使不求助于版本管理,Eclipse 也提供了类似的功能:在 Preferences 中,转到 General -> Workspace -> Local History

回答by yurib

You can export your project as an archive and just save it somewhere, then import it whenever you need/want to. Just right click on the project, choose export and follow the instructions

您可以将项目导出为存档并将其保存在某处,然后在需要/想要时导入它。只需右键单击项目,选择导出并按照说明进行操作

回答by Kos

Version control software is usually the best option, allowing you to create branches and browse revisions easily.

版本控制软件通常是最好的选择,它允许您轻松创建分支和浏览修订。

If you're on Windows, you can set up a local SVN repository using VisualSVN serververy quickly.

如果您使用的是 Windows,则可以非常快速地使用VisualSVN 服务器设置本地 SVN 存储库。

If you'd want the repository online, have a look at Google Code(only open-source) or Assembla(they mostly offer paid services, but do provide nice and free SVN or GIT repositories).

如果您想要在线存储库,请查看Google Code(仅开源)或Assembla(它们主要提供付费服务,但确实提供了不错的免费 SVN 或 GIT 存储库)。