我按照本指南使用GNU Stow来管理我的点文件。这对于机器上没有预先存在的点文件的情况非常有效。例如,如果没有文件,则以下内容可以正常工作:~/.config/foo.cfg
~/.dotfiles$ mkdir -p foo/.config
~/.dotfiles$ echo My config > foo/.config/foo.cfg
~/.dotfiles$ stow foo
~/.dotfiles$ ls -l ~/.config
lrwxrwxrwx 1 user group 21 Dec 6 19:03 ~/.config -> .dotfiles/foo/.config
Run Code Online (Sandbox Code Playgroud)
~/.config/foo.cfg
如果已经存在,它就变得不那么简单:
~/.dotfiles$ stow foo
WARNING! stowing bar would cause conflicts:
* existing target is neither a link nor a directory: foo.cfg
All operations aborted.
Run Code Online (Sandbox Code Playgroud)
到目前为止,我能找到的唯一解决方案是手动删除~/.config/foo.cfg
并重新运行stow foo
. 当向可能有数十个预先存在的 .dot 文件的新计算机配置 stow 存储库时,这是相当尴尬的,并且基本上违背了使用 stow 管理点文件的目的。
斯托有--adopt
选择权。运行的stow --adopt foo
效果是用计算机上 …