Best way to sync work environments between multiple computers (Macs) [closed]

自作多情 提交于 2020-01-14 02:31:11

问题


I'm in the unfortunate position of having to keep three separate macs in sync for development purposes. I've already tried everything I could to reduce it down to one computer, but it's just not possible for legal reasons.

So I'd like to keep the three macs in sync. I have git repos for all the usual things: dot files, each individual project, etc. I use Dropbox to keep documents and application profile files in sync. I also use the App Store to keep what applications are installed in sync.

Things that aren't in sync:

  • What Homebrew packages are installed
  • Rbenv environment (which versions of ruby are installed)
  • Gem environment (hundreds of different gems)
  • The numerous (hundreds actually) git repositories checked out in my ~/workspace directory. Putting in Dropbox is not an option due to the corruption issues that can arise. Besides, git itself is version controlled, it's just the first part of actually checking them out and keeping them up-to-date.

Hopefully this isn't too open ended, but how do you keep the above in sync?


回答1:


  1. Git repos. I don't try to keep them in sync. I take a known working checkout and make a date based tarball. These are stored and accessed by all machines. If a git repo needs to be updated I update the tarball. This is not git specific, I do this with any public revision system.
  2. for package systems I get a list of installed packages and check that in. A self check script or part of the build process can ensure everything is up to date.
  3. I use Python, not Ruby so I use pip and a requirements file coupled with virtualenv to keep me separate from the actual host system. It looks like http://bundler.io/ is the Ruby equivalent.

Basically, imagine that you are trying to make an automated, hourly build process for what you are doing on your desktop(s). This way you have less dev vs. build vs. production issues.




回答2:


If it's items just local to your homedirectory or specific directories on the system I would use rsync.

Something like:

rsync -lpru --progress --exclude="folder_to_exclude" /Users/username username@othermac:/Users/username

l is for sym links p is for permissions r is for recursive u is for update, don't rebase every time.



来源:https://stackoverflow.com/questions/21684962/best-way-to-sync-work-environments-between-multiple-computers-macs

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!