Eclipse workspace backup

2019-01-28 02:19发布

问题:

What do I lose if I skip the .metadata/ directory when doing the back-up of my Eclipse workspace? (Is there some documentation describing what Eclipse stores in this directory)? I've noticed that it changes very often (essentially every time that I use Eclipse (Galileo).

I've seen this question, but I'm not interested in doing a back-up of plug-ins and settings (also because I'm not sure that they would work properly when restored after a re-installation of my PC or on a new PC). I'm just interested in doing a back-up of my projects (source code, libraries, possible data, .svn and .git directories). So, can I safely ignore the .metadata/ directory?

回答1:

You do not generally want to backup .metadata directory because its content is not portable. When you create a new workspace and re-import your projects, you will notice that your workspace preferences will be missing (stuff set under Window -> Preferences). Everything from code style preferences, to path variables to target runtimes. Mitigate your risk by keeping good notes on how you configure your workspace preferences and you will have no problem recovering. Some preferences (like user spelling dictionary and code style) allow you to reference external files. Take advantage of this and put those files in a directory that will be backed up.



回答2:

So, can I safely ignore the .metadata/ directory [in an Eclipse workspace backup]?

Yes. Eclipse will create a new .metadata directory when you create a new project from your source code repository.