0

Using Eclipse, I'm developing and maintaining Java desktop applications. My Mac users have OS X versions from 10.6 to 10.9. My development machine has two disk partitions and can boot either OS X 10.6 running Apple Java 6, or OS X 10.8 running Oracle Java 7. (Note that 10.6 cannot run Java 7; 10.8 cannot run Java 6.) I have an external disk on which Time Machine backs up both OS X partitions.

I want to maintain two versions of an application, one for each Java version. Most source code is identical across versions. While working on a particular version, I boot from the appropriate partition.

I'm looking for a strategy to use Subversion for source code version control. I can put the repository on either OS X partition (both are visible regardless of which is the current boot partition), but I believe it will be backed up by Time Machine only if I have booted from the same partition. I can put the repository on the external disk, but then it does not get backed up by Time Machine. I live in a rural are where broadband Internet is not available, so any remote or "cloud" repository would not be usable.

I can see potential problems in situations where, for example, I've booted into 10.6, edited some files, and then want to reboot into 10.8 for some regression testing. I don't want to have to check in all files before every reboot, and then check them out again after.

I particularly like the convenience of Time Machine's backups and its ability to restore my machine to a known state. Having to adopt a separate strategy for backing up the Subversion repository is less desirable.

I have never used git, but would consider it.

4

2 回答 2

0

我建议您使用 git - 集中式 vcs 根本不适合您的情况 - 哪个磁盘是中央磁盘?我认为两者都不是。使用 DVC 系统,没有中央存储库,这正是您计划的工作方式。

使用 git,每个克隆都是存储库的完整副本*。时间机器并不需要真正参与。

  • 只要您推送所有分支/标签

以下是我建议您布置的方式...

在一个磁盘上初始化您的 git 存储库,默认分支(“主干”)是每个版本共有的代码。

cd <your project>
git init

为您需要支持的每个 java 版本创建一个分支。

git branch <name>

将 repo 克隆到另一个磁盘,并将每个磁盘设置为彼此的远程。

git clone <path>
git remote add <name> <path to other box>

现在你只需在你想要处理的盒子上检查你想要处理的分支,并确保你在提交后推送。

只要原理清楚,我肯定在上面的片段中错过了一个或两个 git 命令

于 2013-10-29T23:17:48.950 回答
0

有人向我指出,Time Machine 可以配置为在内部和外部磁盘上的任何和所有卷上执行备份,而不仅仅是启动卷。这使我的问题变得没有意义:我可以将存储库放在任何地方,然后确保在每个操作系统卷上正确配置了 Time Machine。

于 2013-10-29T23:38:29.813 回答