跨多台机器管理主目录有一些差异吗?
所以我现在已经有了一个非常定制的点文件设置,并且我一直在寻找一种解决方案来保持机器之间的同步。 我喜欢拥有一个 ~/dotfiles 目录(或类似目录)的想法,其中包含一个处理符号链接创建的 makefile。 通过 rsync/unison/dvcs/whatever 将 dotfiles 目录从一台机器移动到另一台机器,我就可以开始了。
出现此问题的原因是某些计算机上的文件略有不同,我想要一种方法来跟踪此问题。 例如,我的 .xmobarrc(为那些不熟悉的人提供的面板应用程序)有一个配置设置,可以在我的笔记本电脑上显示电池寿命,但不能在我的台式机上显示电池寿命。
管理像这样的每台机器差异的文件的最佳方法是什么,这样,如果我在一台机器上更改应该影响所有机器的内容,我可以合并回来,如果我在一台机器上更改不应该得到的内容,我可以合并回来。合并了就不会了 显然,像 git 这样的 DVCS 是必要的,而不是 rsync/unison/etc,但我不知道如何设置它。
主分支,每台机器有一个分支,我可以从中来回合并/变基/樱桃选择? 这似乎有点乏味。 有没有更好的办法?
So I've got a pretty customized setup of dotfiles at this point, and I've been looking for a solution to keep things synchronized from machine to machine. I like the idea of having a ~/dotfiles dir (or similar) that contains a makefile that handles creation of symlinks. Move the dotfiles dir from machine to machine via rsync/unison/dvcs/whatever, and I'm good to go.
The problem with this occurs because the files differ slightly on some machines, and I would like a way to track this. For example, my .xmobarrc (a panel application for those not familiar), has a configuration setting to display battery life on my laptop, but not on my desktop.
What is the best way to manage files with per machine differences like this, in such a way that if I change on one machine something that should affect all machines, I can merge back, and if I change on one machine that shouldn't get merged, it won't. Obviously a DVCS like git is necessary for this as opposed to rsync/unison/etc, but I'm not sure how to set this up.
Master branch with one branch per machine that I merge/rebase/cherry pick back and forth from? This seems a bit tedious. Is there a better way?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
一种方法是:
考虑合并:
One way would be to have:
Considering merges: