Eclipse的本地历史...文件保存在哪里?

编程入门 行业动态 更新时间:2024-10-10 04:23:44
本文介绍了Eclipse的本地历史...文件保存在哪里?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述 有人可以解释Eclipse的本地历史如何工作?

我不小心在项目中覆盖了一个文件,但需要恢复到较早的版本。 Eclipse有没有将旧文件缓存在某个地方?

解决方案

完成CurtainDog的答案:从 eclipse常见问题

每次在Eclipse中修改文件时,旧的内容的副本将保存在本地历史记录中。在任何时候,您可以将文件与历史记录中的任何旧版本进行比较或替换。 虽然这不是替代真正的代码存储库,但是当您更改或删除文件时,可以帮助您事故。 本地历史还有一个优点,它并不是真正设计的:当您的工作区遇到灾难性问题或遇到损坏工作区文件的磁盘错误时,历史记录还可以帮助您。 作为最后的手段,您可以手动浏览本地历史文件夹以查找丢失的文件的副本,这有点像使用Google的缓存来浏览不再存在的网页。

每个文件修订版都存储在历史文件夹内的随机文件名的单独文件中。工作区内的历史文件夹的路径是

.metadata / .plugins / org。 eclipse.core.resources / .history /

您可以使用操作系统的搜索工具查找文件你在找

请注意,如果您需要将本地历史记录导入到新的工作区中,您将需要两者:

  • .metadata / .plugins / org.eclipse.core.resources / .history
  • .metadata / .plugins / org.eclipse.core.resources / .project

具有该新功能的本地历史记录工作区。

Can someone explain how Eclipse's local history works?

I accidentally overwrote a file in a project but need to revert to an earlier version. Is there a chance that Eclipse has the older file cached somewhere?

解决方案

To complete CurtainDog's answer: from eclipse FAQ

Every time you modify a file in Eclipse, a copy of the old contents is kept in the local history. At any time, you can compare or replace a file with any older version from the history. Although this is no replacement for a real code repository, it can help you out when you change or delete a file by accident. Local history also has an advantage that it wasn’t really designed for: The history can also help you out when your workspace has a catastrophic problem or if you get disk errors that corrupt your workspace files. As a last resort, you can manually browse the local history folder to find copies of the files you lost, which is a bit like using Google’s cache to browse Web pages that no longer exist.

Each file revision is stored in a separate file with a random file name inside the history folder. The path of the history folder inside your workspace is

.metadata/.plugins/org.eclipse.core.resources/.history/

You can use your operating system’s search tool to locate the files you are looking for.

Note, if your need to import your local history into a new workspace, you will need both:

  • .metadata/.plugins/org.eclipse.core.resources/.history
  • .metadata/.plugins/org.eclipse.core.resources/.project

to have a functional local history in that new workspace.

更多推荐

Eclipse的本地历史...文件保存在哪里?

本文发布于:2023-11-26 07:49:56,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1633255.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:文件   历史   Eclipse

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!