工具与资源brandon.invergo.net
使用 GNU Stow 管理 dotfiles(2012)
Using GNU Stow to manage your dotfiles (2012)
2013 — 2022,它一次次回到首页
黑点是上首页(≥ 50 分)的那次投稿,空心点是没冲上去的投稿,点越大分数越高。
导读
这篇 2012 年的文章介绍了如何用 GNU Stow 来管理 dotfiles(各类程序的配置文件):把配置集中放在一个 git 仓库里,再用 Stow 自动在 home 目录创建符号链接。方法简单可靠,多年来一直是 dotfiles 管理的经典方案之一。
为什么经久不衰:它用最简单的现成工具解决了 dotfiles 管理问题,无需专门脚本或复杂工具,多年来反复被推荐,至今仍是入门这一话题的最佳起点。
HN 评论精选
普通 git 仓库加手动符号链接就足够,不必用 Stow
恕我守旧,直接建一个普通 git 仓库放所有 dotfiles,再把文件符号链接到需要的地方,有什么不好?你还可以把几条符号链接和命令串成一条可复制的命令快速上手,也能通过加载可选文件轻松管理敏感信息,甚至在 WSL 2 和 Windows 这类跨系统场景下也好用。我这样管理 dotfiles 好几年了,效果不错,还开源在了 GitHub 上。
nickjj查看英文原文
Call me old fashioned but what's wrong with having a regular git repo anywhere you want with all of your dotfiles and them symlink those files to where they need to go? If you wanted to you could && a few symlinks and other commands into 1 copy / paste'able command to get up and running really quickly. It's also painless to manage secrets by sourcing in optional files. It also works nicely when you want files living across 2 systems (such as WSL 2 and Windows) where on a Windows box you consider certain Windows files dotfiles even though technically they exist elsewhere. I've been managing my dotfiles like this for a few years and it seems to be working out well not just for myself but others who have want to use them either partially or in full. I open sourced them here: https://github.com/nickjj/dotfiles I purposely broke up some of the commands because I know that not everyone will want a 100% replica of my dotfiles. Folks copy / paste only the commands they want.
Stow + git + org-mode 可以实现可读性极高的配置管理
Stow 很棒,简单好用,配合 git 尤其合适。我最近还把它和 org-mode 的文学编程结合起来,每个程序只有一个 README.org,通过 org tangle 生成所有配置文件,在 GitHub、Emacs 或纯文本下都清晰可读。
podiki查看英文原文
STOW is great, it is simple and works well especially combined with git. That's what I do [0], and recently combined it with org-mode for literate programming, so each program has just a README.org that then generates all the files via org tangle [1] [2]. For example, here is my file that generates my Xorg configuration [3] over several files, nicely readable on GitHub, in Emacs, or just as plain text. [0] https://github.com/podiki/dot.me/ [1] https://web.archive.org/web/20190924102437/https://expoundite.net/guides/dotfile-management [2] https://orgmode.org/manual/Working-with-Source-Code.html [3] https://github.com/podiki/dot.me/tree/master/x11
bare git 仓库方案可以完全绕开符号链接
你其实不需要符号链接和安装脚本。试试这样:在 home 目录建一个 bare git 仓库,给 git 命令加别名设置 GIT_WORK_TREE 和 GIT_DIR,再用严格的 .gitignore 默认忽略所有文件。添加文件只需 `h git add .vimrc`。我自己就这么用,效果很好。
meagher查看英文原文
You don't need symlinks, setup scripts, etc. Try this: 1. Bare git repo in your home directory ($HOME/.files) 2. Alias for prefixing git commands ("env GIT_WORK_TREE=$HOME GIT_DIR=$HOME/.files") 3. Strict .gitignore file (that ignores all files by default) Simple to add files: `h git add .vimrc` Have this set up for myself. Works great https://github.com/tmm/dotfiles
dotfiles 之外还需要自动化安装软件的配套脚本
我发现只管理 dotfiles 是不够的,没有对应的软件它们毫无用处。我的做法是为每个程序写一个小的安装脚本(我称之为 setuplets),先安装软件再把 dotfile 符号链接到 git 中管理的主版本,新装机器时用工具选择要运行哪些。
mongol查看英文原文
I have found that managing dotfiles is not enough. The dotfiles serve no purpose without the software that uses them. My method is to write small scripts, I call them setuplets, that install the software and then symlink the dotfile to its master that I manage in git. In the simplest case, it is just a two line script in a directory, but I have one for each program, and a tool to select which I run when setting up a new linux machine. The more complex ones may install a number of tools and set up environment variables etc. For environment variables, the script drops a script file in a directory, where my bashrc sources it.
历次讨论
同类还值得读
直接在浏览器中启动 Linux 内核
Boot a linux kernel right inside your browser.
Fabrice Bellard 的 JSLinux 页面,用 JavaScript 在浏览器里启动一个 Linux 内核,并提供一个可交互的终端环境。
工具与资源上首页 5 次 · 2011–2025bellard.orgHacker News 未公开功能与行为清单(2018)
A List of Hacker News's Undocumented Features and Behaviors (2018)
数据科学家 Max Woolf 整理的 Hacker News 未公开功能与行为清单,涵盖投票机制、排名算法、账号惩罚等社区运作细节。
工具与资源上首页 5 次 · 2019–2025github.comMapSCII:在终端中用盲文和 ASCII 渲染地图
MapSCII – Braille and ASCII map renderer for the console
MapSCII 是一个在命令行终端里渲染地图的开源工具,用盲文字符和 ASCII 字符把地理数据画成可交互浏览的字符地图。
工具与资源上首页 5 次 · 2017–2025github.com顶尖大学的免费在线课程
Free Online Courses from Top Universities
Open Culture 整理的一份免费在线课程合集,汇集了全球顶尖大学(如 MIT、斯坦福、耶鲁等)向公众开放的网络课程资源,涵盖音频、视频等多种形式。
工具与资源上首页 5 次 · 2010–2022openculture.com淘气字符串:容易引发用户输入问题的字符串清单
Naughty Strings: A list of strings likely to cause issues as user-input data
一个 GitHub 仓库,收录了大量容易让程序出问题的用户输入字符串,如特殊字符、emoji、SQL 注入片段、系统命令等,供开发者用于测试输入处理逻辑。
工具与资源上首页 4 次 · 2015–2020github.com