如何在两台机器之间保持eclipse工作区同步?

时间:2022-01-03 10:26:53

I have nearly identical Linux (Fedora) machines at home and at work and I keep my files on both machines synchronized using the excellent Unison program. I have been trying to keep an eclipse workspace synchronized across the two machines but this has failed. I tried both:

我在家里和工作中都有几乎相同的Linux(Fedora)机器,我使用优秀的Unison程序将我的文件保存在两台机器上。我一直试图在两台机器上保持eclipse工作区同步,但这已经失败了。我试过了两个:

  1. Synchronize just the /workspace directory, badness due to plugin upgrades
  2. 仅同步/ workspace目录,由于插件升级导致的不良

  3. Synchronize both /workspace and my .eclipse/ director.
  4. 同步/ workspace和我的.eclipse / director。

What happens is that I work in one machine, create new projects on eclipse, etc. Then unison. Then when I go to the other machine the projects will sometimes not appear, sometimes they will appear but eclipse cannot find the files, and sometimes (rarely) it works.

会发生什么是我在一台机器上工作,在日食上创建新项目等等。然后一致。然后,当我去另一台机器时,项目有时候不会出现,有时它们会出现,但eclipse无法找到文件,有时(很少)它可以工作。

I don't understand why eclipse gets so confused since I have identical workspaces, eclipse versions, and even .eclipse directories.

我不明白为什么eclipse因为我有相同的工作空间,eclipse版本甚至.eclipse目录而变得如此困惑。

7 个解决方案

#1


2  

Take a look at Pulse. It's an Eclipse distribution that can handle synchronization of workspace preferences across users and machines. It might be what you need.

看看Pulse。它是一个Eclipse发行版,可以处理用户和计算机之间工作区首选项的同步。它可能是你需要的。

#2


3  

Have considered going through a source control repository? If privacy is a concern, there are private SVN spaces available (e.g. assembla).

是否已考虑通过源控制存储库?如果担心隐私,则可以使用私有SVN空间(例如,组合)。

I understand this technique will (at least) make it possible to synchronize the projects but probably not all the settings related to a workspace. It might be an option, no?

我知道这种技术(至少)可以同步项目,但可能不是所有与工作区相关的设置。这可能是一种选择,不是吗?

#3


2  

I have been using dropbox to synchronize my workspace. I have been able to work on 3 different computers so far without any issues.

我一直在使用Dropbox同步我的工作区。到目前为止,我已经能够在3台不同的计算机上工作而没有任何问题。

#4


1  

I used to store my workspace(s) and sometimes the eclipse installation itself on a USB stick drive and use that for project portability from windows machine to windows machine. You can then just run Eclipse from the stick and mount the workspace on the same stick.

我曾经将我的工作空间(有时候是eclipse安装本身)存储在USB记忆棒驱动器上,并将其用于从Windows机器到Windows机器的项目可移植性。然后,您可以从棒上运行Eclipse并将工作区安装在同一根棒上。

I have also heard that drop box (http://getdropbox.com - they have a 2gb free plan) is useful for this, though I have not tried it.

我也听说过dropbox(http://getdropbox.com - 他们有2gb的免费计划)对此很有用,尽管我还没有尝试过。

It's odd that it does not work with your sync software.

奇怪的是它不能与您的同步软件一起使用。

#5


1  

I've ad issues with unison and eclipse and have them mostly worked out though it still needs to refresh the entire workspace when I switch systems.

我发布了unison和eclipse的广告问题,虽然在我切换系统时仍然需要刷新整个工作区,但它们大部分已经解决了。

There are two issues I've discovered that need to be configured before it is at all happy:

我发现有两个问题需要在它开心之前进行配置:

1) sync your workspace, your eclipse install and ~/.eclipse

1)同步你的工作区,你的eclipse安装和〜/ .eclipse

2) Specify "ignorenot" rules in your unison "prf" files to not ignore any files in these directories. This is necessary because, by default, unison excludes files it thinks are built unsing rules similar to CVS which causes issues.

2)在unison“prf”文件中指定“ignorenot”规则,不要忽略这些目录中的任何文件。这是必要的,因为默认情况下,unison排除它认为构建的类似于CVS的unsing规则导致问题的文件。

for example:

path = eclipse
path = workspace
path = .eclipse
ignorenot Regex eclipse/.*
ignorenot Regex workspace/.*
ignorenot Regex .eclipse/.*

#6


0  

Have you considered setting up a network drive and installing Eclipse on that drive (along with your workspace)? That way, when you open Eclipse on either machine, it will be pointing at the network path for your workspace. I've successfully used this solution in the past.

您是否考虑过设置网络驱动器并在该驱动器上安装Eclipse(以及工作区)?这样,当您在任一计算机上打开Eclipse时,它将指向您工作区的网络路径。我过去成功使用过这个解决方案。

#7


0  

I used the Mercurial DVSC on a USB stick as the transfer between home and work. I had three Mercurial repositories: one on the USB stick, one at home and one at the office sharing the same space as my Subversion checkout. If you're up-to-speed with DVSC concepts, I'd push/pull changes from office->USB->home.

我在USB记忆棒上使用Mercurial DVSC作为家庭和工作之间的转移。我有三个Mercurial存储库:一个在USB记忆棒上,一个在家中,一个在办公室,与Subversion结帐时共享相同的空间。如果您熟悉DVSC概念,我会从办公室 - > USB-> home推送/拉出更改。

It worked fine, but the first check-in was a pain as USB flash writes have crappy speeds. Pushing/pulling deltas was fairly quick afterwords.

它运行良好,但第一次登记是一个痛苦,因为USB闪存写入速度很快。推动/拉动三角洲之后相当快。

I believe the Mozilla guys use a similar hybrid approach of SVN for the 'official' repository, but the developers use Mercurial for their development environment.

我相信Mozilla的人们使用SVN的类似混合方法用于“官方”存储库,但开发人员使用Mercurial作为他们的开发环境。

#1


2  

Take a look at Pulse. It's an Eclipse distribution that can handle synchronization of workspace preferences across users and machines. It might be what you need.

看看Pulse。它是一个Eclipse发行版,可以处理用户和计算机之间工作区首选项的同步。它可能是你需要的。

#2


3  

Have considered going through a source control repository? If privacy is a concern, there are private SVN spaces available (e.g. assembla).

是否已考虑通过源控制存储库?如果担心隐私,则可以使用私有SVN空间(例如,组合)。

I understand this technique will (at least) make it possible to synchronize the projects but probably not all the settings related to a workspace. It might be an option, no?

我知道这种技术(至少)可以同步项目,但可能不是所有与工作区相关的设置。这可能是一种选择,不是吗?

#3


2  

I have been using dropbox to synchronize my workspace. I have been able to work on 3 different computers so far without any issues.

我一直在使用Dropbox同步我的工作区。到目前为止,我已经能够在3台不同的计算机上工作而没有任何问题。

#4


1  

I used to store my workspace(s) and sometimes the eclipse installation itself on a USB stick drive and use that for project portability from windows machine to windows machine. You can then just run Eclipse from the stick and mount the workspace on the same stick.

我曾经将我的工作空间(有时候是eclipse安装本身)存储在USB记忆棒驱动器上,并将其用于从Windows机器到Windows机器的项目可移植性。然后,您可以从棒上运行Eclipse并将工作区安装在同一根棒上。

I have also heard that drop box (http://getdropbox.com - they have a 2gb free plan) is useful for this, though I have not tried it.

我也听说过dropbox(http://getdropbox.com - 他们有2gb的免费计划)对此很有用,尽管我还没有尝试过。

It's odd that it does not work with your sync software.

奇怪的是它不能与您的同步软件一起使用。

#5


1  

I've ad issues with unison and eclipse and have them mostly worked out though it still needs to refresh the entire workspace when I switch systems.

我发布了unison和eclipse的广告问题,虽然在我切换系统时仍然需要刷新整个工作区,但它们大部分已经解决了。

There are two issues I've discovered that need to be configured before it is at all happy:

我发现有两个问题需要在它开心之前进行配置:

1) sync your workspace, your eclipse install and ~/.eclipse

1)同步你的工作区,你的eclipse安装和〜/ .eclipse

2) Specify "ignorenot" rules in your unison "prf" files to not ignore any files in these directories. This is necessary because, by default, unison excludes files it thinks are built unsing rules similar to CVS which causes issues.

2)在unison“prf”文件中指定“ignorenot”规则,不要忽略这些目录中的任何文件。这是必要的,因为默认情况下,unison排除它认为构建的类似于CVS的unsing规则导致问题的文件。

for example:

path = eclipse
path = workspace
path = .eclipse
ignorenot Regex eclipse/.*
ignorenot Regex workspace/.*
ignorenot Regex .eclipse/.*

#6


0  

Have you considered setting up a network drive and installing Eclipse on that drive (along with your workspace)? That way, when you open Eclipse on either machine, it will be pointing at the network path for your workspace. I've successfully used this solution in the past.

您是否考虑过设置网络驱动器并在该驱动器上安装Eclipse(以及工作区)?这样,当您在任一计算机上打开Eclipse时,它将指向您工作区的网络路径。我过去成功使用过这个解决方案。

#7


0  

I used the Mercurial DVSC on a USB stick as the transfer between home and work. I had three Mercurial repositories: one on the USB stick, one at home and one at the office sharing the same space as my Subversion checkout. If you're up-to-speed with DVSC concepts, I'd push/pull changes from office->USB->home.

我在USB记忆棒上使用Mercurial DVSC作为家庭和工作之间的转移。我有三个Mercurial存储库:一个在USB记忆棒上,一个在家中,一个在办公室,与Subversion结帐时共享相同的空间。如果您熟悉DVSC概念,我会从办公室 - > USB-> home推送/拉出更改。

It worked fine, but the first check-in was a pain as USB flash writes have crappy speeds. Pushing/pulling deltas was fairly quick afterwords.

它运行良好,但第一次登记是一个痛苦,因为USB闪存写入速度很快。推动/拉动三角洲之后相当快。

I believe the Mozilla guys use a similar hybrid approach of SVN for the 'official' repository, but the developers use Mercurial for their development environment.

我相信Mozilla的人们使用SVN的类似混合方法用于“官方”存储库,但开发人员使用Mercurial作为他们的开发环境。