TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Using GNU Stow to manage your dotfiles (2012)

71 pointsby marcinrealalmost 3 years ago

18 comments

dangalmost 3 years ago
Related:<p><i>Using GNU Stow to manage your dotfiles (2012)</i> - <a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=25549462" rel="nofollow">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=25549462</a> - Dec 2020 (113 comments)<p><i>Using GNU Stow to manage dotfiles (2013)</i> - <a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=15196141" rel="nofollow">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=15196141</a> - Sept 2017 (24 comments)<p><i>Using GNU Stow to manage your dotfiles</i> - <a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=8487840" rel="nofollow">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=8487840</a> - Oct 2014 (68 comments)<p><i>Using GNU Stow to manage your dotfiles</i> - <a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=6331485" rel="nofollow">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=6331485</a> - Sept 2013 (69 comments)
评论 #32263784 未加载
neeasadealmost 3 years ago
Been doing this for about a decade, it works nicely. Def recommend stows `--no-folding` flag (which prevents it from symlinking directories, just files)<p>obligatory vanity link: <a href="http:&#x2F;&#x2F;noriceno.life" rel="nofollow">http:&#x2F;&#x2F;noriceno.life</a>
hoosiereealmost 3 years ago
Huh, I guess I implemented something like stow for myself without realizing it.<p>I keep my dotfiles in a private git repo, and in that repo is a shell script that creates symlinks (or creates folders with symlinks inside).<p>Paths are hard-coded in the shell script, but that actually reduces my cognitive load.
评论 #32255287 未加载
romeobladealmost 3 years ago
I started using fossil for this very thing. I was using git, however I like that fossil allows you to put the repository where ever you want on the file system. I don&#x27;t have to worry about alias&#x27;s, using .gitignore, or setting it it up where it doesn&#x27;t show untracked files.<p>As far as fossil is concerned, once you close the repo, it&#x27;s out of site of mind. I still use git for most everything else. Only my dot files and my personal obsidian vaults are backed up to fossil.
评论 #32254725 未加载
评论 #32254223 未加载
canistelalmost 3 years ago
I have to admit, sheepishly, that I use RCS for version controlling dot files and even files such as fstab and grub. I use it in Windows too.<p>Infrequently, even on binary files (smirk).<p>There, I have said it, and taken the load off my conscience...
评论 #32255288 未加载
jasonpeacockalmost 3 years ago
There&#x27;s also `homesick`[1], which is a Ruby dotfile manager. If you don&#x27;t feel like managing a Ruby distro and want something more portable (and `homesick` looks to be a stale project anyway), you can use `homeshick`[2] which is a Bash port that&#x27;s still being maintained. (I use `homeshick`)<p>The last time I dug into this, `homeshick` was had more features and fit my needs better than `stow`.<p>Alternatively, check out YADM[3], &quot;Yet Another Dotfile Manager&quot;, which I&#x27;m probably switching to once I get some time.<p>[1] <a href="https:&#x2F;&#x2F;github.com&#x2F;technicalpickles&#x2F;homesick" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;technicalpickles&#x2F;homesick</a><p>[2] <a href="https:&#x2F;&#x2F;github.com&#x2F;andsens&#x2F;homeshick" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;andsens&#x2F;homeshick</a><p>[3] <a href="https:&#x2F;&#x2F;yadm.io&#x2F;" rel="nofollow">https:&#x2F;&#x2F;yadm.io&#x2F;</a>
评论 #32259137 未加载
5e92cb50239222balmost 3 years ago
I very much prefer this simple method:<p><a href="https:&#x2F;&#x2F;www.atlassian.com&#x2F;git&#x2F;tutorials&#x2F;dotfiles" rel="nofollow">https:&#x2F;&#x2F;www.atlassian.com&#x2F;git&#x2F;tutorials&#x2F;dotfiles</a><p>tl;dr: it puts the .git directory aside and lets you use it to store any files on your filesystem.<p>All the usual commands work, except you use something like `config` or `dofiles` instead of `git`:<p><pre><code> $ config add ~&#x2F;.config $ config commit -m initial\ commit </code></pre> It&#x27;s pretty much the same as creating a git repository in &#x2F;, but doesn&#x27;t mess with your normal git usage (so if you run `git status` in `&#x2F;home&#x2F;foo&#x2F;src&#x2F;my-awesome-project` and git repository has not been created there yet, git will fail with &quot;not a git repository&quot; and won&#x27;t show you the contents of your whole filesystem tree).
评论 #32261049 未加载
评论 #32254335 未加载
评论 #32253238 未加载
评论 #32253239 未加载
tpoacheralmost 3 years ago
I&#x27;ve seen this post on hackernews a few times now (as dang diligently pointed out).<p>However, typically they don&#x27;t mention that more recent versions of Stow actually have specific functionality for dotfiles, which is support for the `dot-` prefix.<p>Check the man page for your version of stow. If the string &quot;dot-&quot; doesn&#x27;t appear anywhere, you have an old version of stow.<p>Also interesting to me was the fact that the `make` manual has information on how `stow` is actually one of the recommended workflows in makefiles (in the context of setting a DESTDIR); but I&#x27;ve never seen anyone actually do that in practice.
simjuealmost 3 years ago
Shameless self-plug: I could never get along with storing the whole content of the dotfiles when I casually just added a few lines I cared about, so I developed my own tool called confible. You can specify to just append a few lines or add the whole config and it can run commands (e.g. installing the specific tool together with its config). You can find it at <a href="https:&#x2F;&#x2F;github.com&#x2F;sj14&#x2F;confible" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;sj14&#x2F;confible</a>
评论 #32253914 未加载
j1eloalmost 3 years ago
It&#x27;s 2022 and I still use this program since I read that article so many years ago.<p>It&#x27;s handy but sometimes a bit of manual preparation must be done on a new clean machine. For example if you want to stow only some files under ~&#x2F;.config&#x2F;program&#x2F; and not the whole program&#x2F; directory, you must first run an mkdir and <i>then</i> run stow to put the appropriate symlinks in place.
评论 #32258248 未加载
评论 #32253878 未加载
评论 #32255125 未加载
pheasantquiffalmost 3 years ago
(since no one has mentioned it yet). This project&#x27;s name sounds a lot like GNUSTO,<p>a magic word used in the Infocom&#x2F;Sorcerer games to record an incantation in your spell book.<p><a href="https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Sorcerer_(video_game)" rel="nofollow">https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Sorcerer_(video_game)</a>
politelemonalmost 3 years ago
It feels unsafe to store dot files in source control as the article mentions. Is this a common practice? They could contain sensitive information and I fear people might be tempted to push to GitHub.<p>What about storing such files in a password manager&#x2F;database?
评论 #32253297 未加载
评论 #32253360 未加载
评论 #32253409 未加载
评论 #32258412 未加载
评论 #32254138 未加载
评论 #32253410 未加载
blueflowalmost 3 years ago
Track you ~&#x2F;.config (or whatever your XDG_CONFIG_HOME is) directory in git, and create symlinks for those programs that don&#x27;t look there, optionally by script. Many programs already use that directory to store their configs. The Arch Linux folks are nagging every upstream into supporting it[1]. Also it requires no extra dependency aside git.<p>I think i say this everytime a dotfiles manager comes up.<p>[1] <a href="https:&#x2F;&#x2F;wiki.archlinux.org&#x2F;title&#x2F;XDG_Base_Directory" rel="nofollow">https:&#x2F;&#x2F;wiki.archlinux.org&#x2F;title&#x2F;XDG_Base_Directory</a>
评论 #32256240 未加载
评论 #32255485 未加载
pilchaalmost 3 years ago
After trying a bunch of tools I settled on git-tracking $HOME with &#x27;*&#x27; on my .gitignore (ignores everything, you have to add new files by --force). Is this better? symlinks seem like a smell.
评论 #32254578 未加载
评论 #32260964 未加载
AndrewVosalmost 3 years ago
I use my own tool for this: <a href="https:&#x2F;&#x2F;github.com&#x2F;AndrewVos&#x2F;pj" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;AndrewVos&#x2F;pj</a>
vinceguidryalmost 3 years ago
I wound up writing my own stow replacement in Ruby, that moved the files rather than symlinked them. It does pattern-match the filenames with a list, anything on the list gets symlinked. It can also copy home-rolled binaries into &#x2F;usr&#x2F;local&#x2F;bin. I suppose I could use both stow and etckeeper but a simple script can keep everything synced to my precise liking.
milicatalmost 3 years ago
Interesting. I&#x27;d consider it, if I wasn&#x27;t already on NixOS with home-manager.
评论 #32255459 未加载
评论 #32254484 未加载
smm11almost 3 years ago
rsync dot files to wherever.
评论 #32253224 未加载