Eclipse 跨计算机同步工作区/视角/首选项
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/958508/
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
Eclipse sync workspaces/perspectives/preferences across computers
提问by Naren
I have a project I need to be working on from two different computers, at work and at home. I need to be able to work on the code from both computers, so the issue is two fold;
我有一个项目需要在工作和家里的两台不同的计算机上进行。我需要能够在两台计算机上处理代码,所以问题是双重的;
- Sharing the code
- Sharing the workspace.
- 分享代码
- 共享工作区。
1 is simple enough with svn; but I feel icky committing broken code to svn just so I can access that again from home. I can live with this but is there a better option?
1 用 svn 就够简单了;但我觉得将损坏的代码提交给 svn 只是为了让我可以从家里再次访问它。我可以忍受这个,但有更好的选择吗?
To elaborate more on 2. I have a highly customized eclipse setup on one of the computers where I spent hours adding plugins and tweaking every tiny config options I could access to get it to the point where it is just right. It'll be a pain redoing every single change on the other computer, is there some way to automatically sync that? I know I can export preferences from Eclipse and import them, but I don't want to have to manually do that each time I change something. [Also, I don't think exporting preferences also exports perspectives?]
详细说明 2. 我在其中一台计算机上进行了高度定制的 eclipse 设置,我花了数小时添加插件并调整我可以访问的每个微小配置选项,以使其达到恰到好处的程度。在另一台计算机上重做每一个更改都会很痛苦,有什么方法可以自动同步吗?我知道我可以从 Eclipse 导出首选项并导入它们,但我不想每次更改某些内容时都必须手动执行此操作。[另外,我不认为输出偏好也输出观点?]
Both computers run windows.
两台计算机都运行Windows。
采纳答案by Naren
To followup on this, i've been using Pulse with some success poweredbypulse.com. Its not the ideal solution but it's been working pretty well for me so far.
为了跟进此事,我一直在使用 Pulse 并取得了一些成功powerbypulse.com。它不是理想的解决方案,但到目前为止对我来说效果很好。
回答by Pete TerMaat
Portable Development Environment
便携式开发环境
Not that you'd want to run from a USB flash drive, but you can bundle Eclipse and the JDK all in one directory, as described here, to have a nicely self-contained development environment:
并不是说您想从 USB 闪存驱动器运行,而是可以将 Eclipse 和 JDK 全部捆绑在一个目录中,如此处所述,以获得一个很好的自包含开发环境:
You can toss in a few more tools too if needed:
如果需要,您也可以添加更多工具:
- How-to: Free Portable Web Development on a USB Drive
- StackOverflow: Development tools for a USB drive
- ServerFault: Tools that fit on a USB drive
See PortableAppsfor additional tools, including one that will put a menu in your system tray giving you quick access to all your portable tools.
有关其他工具,请参阅PortableApps,其中包括将菜单放在系统托盘中的工具,可让您快速访问所有便携式工具。
Once you've got that set up, then use an option like one of the following to share the directory across workstations:
完成设置后,请使用以下选项之一在工作站之间共享目录:
External Hard Drive
外置硬盘
A flash drive would be too slow, but often an external HDD is fine. Of course, you've got to lug it around. And it's no fun when you forget to bring it to work one day--as I did my laptop yesterday. :-) Drive letter changes can be another problem.
闪存驱动器会太慢,但通常外部硬盘驱动器没问题。当然,你必须拖着它到处走。当你有一天忘记带它去上班时,这并不有趣——就像我昨天用我的笔记本电脑一样。:-) 驱动器号更改可能是另一个问题。
Mirroring Tools
镜像工具
A mirroring/backup tool is simple but error-prone. These are one-way tools, in that they copy everything from one workstation to another. The risk is that you make changes at one workstation, forget to run the tool, then change the same file(s) at your other workstation, and run the tool, overwriting your changes.
镜像/备份工具简单但容易出错。这些是单向工具,因为它们将所有内容从一个工作站复制到另一个工作站。风险在于您在一个工作站上进行更改,忘记运行该工具,然后在另一个工作站上更改相同的文件,并运行该工具,覆盖您的更改。
- rsync
- DeltaCopy
- 同步
- 增量复制
Synchronization Tools
同步工具
A step up from a mirroring tool would be a syncronization tool. These detect changes and allow you to make choices about merging. You have to remember to run it manually, or use another tool to schedule it to run at certain times.
镜像工具的升级将是同步工具。这些检测更改并允许您选择合并。您必须记住手动运行它,或者使用其他工具安排它在特定时间运行。
Synchronization Services
同步服务
These are services that automatically sync files between workstations. Most, if not all of them handle conflicts, and allow access to previous versions of files. They are nice because they are set-and-forget. You don't have to remember to run a mirror or sync tool. Also, these eliminate the need to leave one workstation powered up so that you can manually sync to it when you get to the other workstation.
这些是在工作站之间自动同步文件的服务。大多数(如果不是全部)处理冲突,并允许访问以前版本的文件。它们很好,因为它们是一劳永逸的。您不必记住运行镜像或同步工具。此外,这些消除了让一个工作站通电的需要,以便您在到达另一台工作站时可以手动同步到它。
- Dropbox(One quirk here for users of Instant Railsis that the space in the "My Dropbox" folder name is a show stopper.)
- SpiderOak
- Syncplicity
- Windows Live Sync
- Dropbox(对于Instant Rails用户来说,这里的一个怪癖是“My Dropbox”文件夹名称中的空间是一个显示塞子。)
- 蜘蛛橡木
- 同步性
- Windows 实时同步
回答by Kariem
I have just tried out the recently announcedworkspace mechanicsplugin. It seems to be made exactly for the second part of the question.
我刚刚试用了最近发布的工作区机制插件。它似乎正是为问题的第二部分而提出的。
You will need to provide a directory where the preferences are to be stored (by default ~/.eclipse/mechanic
). With the plugin installed, preferences can be easily exported to separate files. If you start a new workspace and point the plugin to the right directory (or leave the default), a dialog is displayed that lets you choose what settings to apply to the current workspace.
您需要提供一个目录来存储首选项(默认情况下~/.eclipse/mechanic
)。安装插件后,首选项可以轻松导出到单独的文件。如果您启动一个新工作区并将插件指向正确的目录(或保留默认值),则会显示一个对话框,让您选择要应用于当前工作区的设置。
回答by Brucexcore
In regards to problem #1, I use Dropbox and have been very happy with it.
关于问题 #1,我使用 Dropbox 并且对它非常满意。
I did notice one problem opening a project after being updated on another machine: Eclipse picks up changes in existing files but does not automatically add new files. This is resolved by simply right clicking the project and selecting 'Refresh'.
我确实注意到在另一台机器上更新后打开项目的一个问题:Eclipse 选择现有文件中的更改,但不会自动添加新文件。只需右键单击项目并选择“刷新”即可解决此问题。
回答by hubbardr
You might consider using Pulse. Its free and its great for generating a standard Eclipse installation that includs all your plugins and workspace settings (if you use the freelance version - not free). Its nice to be able to generate one working Eclipse configuration and then repeat that same profile installation on another computer OR share that profile with an entire team.
您可以考虑使用Pulse。它是免费的,并且非常适合生成标准的 Eclipse 安装,其中包括所有插件和工作区设置(如果您使用自由版本 - 不是免费的)。很高兴能够生成一个有效的 Eclipse 配置,然后在另一台计算机上重复相同的配置文件安装或与整个团队共享该配置文件。
回答by Gabe Moothart
Regarging #1, I've thought about this too. Microsoft's TFS has a "shelve" feature which does what you want (store pending changes on the server without committing). It's kind of like a personal branch.
关于#1,我也考虑过这个。Microsoft 的 TFS 具有“搁置”功能,可以执行您想要的操作(将挂起的更改存储在服务器上而不提交)。这有点像个人分支。
In subversion I would probably create a branch for my bleeding-edge, maybe-broken code, and just merge to trunk periodically.
在 subversion 中,我可能会为我的前沿代码创建一个分支,可能是损坏的代码,然后定期合并到主干。
回答by Matt
I utilize rsync to do a similar thing between my laptop(OSX) and desktop(linux).
我利用 rsync 在我的笔记本电脑(OSX)和台式机(linux)之间做类似的事情。
A quick google search mentions rsync is available for windows - so this may be an option for you.
快速谷歌搜索提到 rsync 可用于 Windows - 所以这可能是你的一个选择。
You can probably set this up to be set on a schedule by your OS. I personally have it set up for when I access my office network or when files are changed.
您可能可以将其设置为由您的操作系统按计划进行设置。我个人在访问我的办公室网络或更改文件时设置了它。
回答by Chris Nava
Eclipse and most other java tools are easily portable.
Eclipse 和大多数其他 Java 工具都易于移植。
You can copy the them to a thumb drive and run them on any machine. For the JDK it needs to have a similar OS.
您可以将它们复制到 U 盘并在任何机器上运行。对于 JDK,它需要有一个类似的操作系统。
I have a "C:\Development" folder with eclipse, java, jboss, workspace, ant, maven, svn, etc.. which I can unzip and drop in C: on any windows machine and run my environment.
我有一个包含 eclipse、java、jboss、workspace、ant、maven、svn 等的“C:\Development”文件夹。我可以在任何 Windows 机器上解压并放入 C: 并运行我的环境。
I don't run it off the thumb drive because you never know which letter the drive will get and some of the references eclipse keeps are fully qualified.
我不会从拇指驱动器上运行它,因为你永远不知道驱动器会得到哪个字母,而且 eclipse 保留的一些参考是完全合格的。
回答by Nate W.
Or simply Remote Desktop into your preferred computer from the other.
或者简单地将远程桌面从另一台计算机连接到您的首选计算机。