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.

Managing Dotfiles with GNU Stow (2016)

170 pointsby harporoederabout 4 years ago

16 comments

chrismorganabout 4 years ago
(2016)<p>&gt; <i>GitHub even has a website dedicated to different ways of organising and deploying them &lt;<a href="https:&#x2F;&#x2F;dotfiles.github.com&#x2F;" rel="nofollow">https:&#x2F;&#x2F;dotfiles.github.com&#x2F;</a>&gt;.</i><p>404, I presume <a href="https:&#x2F;&#x2F;dotfiles.github.io" rel="nofollow">https:&#x2F;&#x2F;dotfiles.github.io</a> is what they were referring to, which is not affiliated with GitHub at all. (And there you see one of the reasons for shifting user content away from *.github.com to a different domain.)<p>----<p>This submission is presumably inspired by a current&#x2F;recent discussion at <a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=27134249" rel="nofollow">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=27134249</a> on <i>A Way To Manage Dotfiles</i>, <a href="https:&#x2F;&#x2F;github.com&#x2F;kalkayan&#x2F;dotfiles" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;kalkayan&#x2F;dotfiles</a>, which is predicated upon another approach: using a bare Git repository with its work tree as the root of $HOME.
评论 #27137788 未加载
评论 #27137395 未加载
fungiblecogabout 4 years ago
I&#x27;ve tried using a number of these solutions but I always have the same problem which is that after a while not using it regularly I&#x27;d want to make a change and forget the magic incantations, get frustrated and stop bothering.<p>To be fair I also have this problem a lot administering my linux machines because they just work - until they don&#x27;t. Then I have to re-learn what to do to fix the problem.
评论 #27140426 未加载
评论 #27138772 未加载
评论 #27138480 未加载
评论 #27138357 未加载
res0nat0rabout 4 years ago
I&#x27;ve tried this and a lot of other dotfile managers (homesick, homeshick, etc), my current favorite and what I&#x27;m using now is YADM:<p><a href="https:&#x2F;&#x2F;yadm.io&#x2F;" rel="nofollow">https:&#x2F;&#x2F;yadm.io&#x2F;</a>
评论 #27140415 未加载
评论 #27138917 未加载
评论 #27141241 未加载
评论 #27138815 未加载
评论 #27139814 未加载
评论 #27137764 未加载
user3939382about 4 years ago
If I had the opportunity I always thought it would be fun to learn and then modify the Linux kernel so that file lookups to ~&#x2F;.* get redirected to ~&#x2F;config&#x2F;.* and I could finally have a clean home directory.
评论 #27138953 未加载
评论 #27137996 未加载
评论 #27138100 未加载
评论 #27139082 未加载
评论 #27137989 未加载
评论 #27139262 未加载
kohlermabout 4 years ago
Nix plus homemanager plus direnv is the best solution I have found so far. Managing config (dotfiles) is only one part of the problem. You usually also need some way to install applications&#x2F;tools ideally in a specific version. your config might not work as expected with a different version and you would have to remember what exactly you installed. As a developer using direnv will even allow you to use different versions of tools for different projects&#x2F; directories
评论 #27139685 未加载
评论 #27139137 未加载
评论 #27139115 未加载
cespareabout 4 years ago
I just make my home directory be a git repo directly. That&#x27;s even simpler -- no symlinks. You have to get used to having a repo with many unchecked-in files, but it works well enough. I have a git alias or two to help. This has been a good solution for me for more than a decade across ~a dozen OS installations.
评论 #27137619 未加载
评论 #27137669 未加载
评论 #27137930 未加载
评论 #27140030 未加载
diegoholiveiraabout 4 years ago
I use GNU Stow to manage my dotfiles and it&#x27;s awesome because with Stow and Brew, I could create a script that setup everything in my machine from scratch, with one command. If anyone wants to take a look, it&#x27;s here: <a href="https:&#x2F;&#x2F;GitHub.com&#x2F;diegoholiveira&#x2F;dotfiles" rel="nofollow">https:&#x2F;&#x2F;GitHub.com&#x2F;diegoholiveira&#x2F;dotfiles</a>
评论 #27138493 未加载
noisy_boyabout 4 years ago
Whenever I install a new distro, I never format &#x2F;home partition. Also, I rename my home directory to &lt;username&gt;_old and create a new one. I start with mv of the most common files&#x2F;directories like .bashrc&#x2F;.mozilla etc and gradually move more as I need. This way after 2-3 months, I&#x27;ve left the old&#x2F;unused cruft behind and can remove the _old home directory (in practice I keep them around because the size is small since I keep most of my documents in a separate partition and just symlink to that). If I&#x27;m changing computers, I restore the home from daily backup, rename it to _old and do the same thing.
评论 #27138699 未加载
kart23about 4 years ago
&gt; But, as you can imagine, manually linking dotfiles quickly becomes laborious and error-prone. One solution is to create a script that links the files for you, but I think there’s a better way.<p>Yeah I have no issues doing this. I can count on any machine having bash and git, and I don&#x27;t have to relearn how the tool works every few months.
评论 #27140336 未加载
syl_sauabout 4 years ago
I think that in this case like in many others, the more the tool approximates the behavior of something you already know, the easier it is to use. I don&#x27;t want to lose time learning yet another tool just for syncing 7 dotfiles from a machine to another.<p>I&#x27;ve been going with `vcsh`[1] for 2 years now -- essentially a wrapper git that works with a home directory git repo without all the annoyances. To be fair I don&#x27;t even exactly knows how it works (which may be a testament to how nicely it is done). It&#x27;s just basic git commands and it doesn&#x27;t create a .git in your home folder.<p>As simple as : $ vcsh {name_of_repo} status # check changed files $ vcsh {name_of_repo} add .. $ vcsh {name_of_repo} commit .. $ vcsh {name_of_repo} pull .. $ vcsh {name_of_repo} push ..<p>[1]: <a href="https:&#x2F;&#x2F;github.com&#x2F;RichiH&#x2F;vcsh" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;RichiH&#x2F;vcsh</a>
encryptluks2about 4 years ago
chezmoi seems really promising. Been planning on migrating my dotfiles to it soon:<p><a href="https:&#x2F;&#x2F;www.chezmoi.io&#x2F;" rel="nofollow">https:&#x2F;&#x2F;www.chezmoi.io&#x2F;</a>
评论 #27138636 未加载
pabs3about 4 years ago
More dotfiles stuff on the vcs-home wiki:<p><a href="https:&#x2F;&#x2F;vcs-home.branchable.com&#x2F;" rel="nofollow">https:&#x2F;&#x2F;vcs-home.branchable.com&#x2F;</a>
shepherdjerredabout 4 years ago
I used stow for a few years, but I outgrew stow when dealing with different architectures (arm vs x86_64) and OS (macOS, Debian based, RHEL based).<p>I settled upon chezmoi and don&#x27;t have any complaints aside from it being a little bit cumbersome when merging (mostly due to my inexperience)<p><a href="https:&#x2F;&#x2F;github.com&#x2F;twpayne&#x2F;chezmoi" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;twpayne&#x2F;chezmoi</a>
manifoldgeoabout 4 years ago
I did a CTRL + F for “docker” and “container” and surprisingly didn’t see any hits in the first page of comments.<p>I’ve found it’s a lot easier to just make a single docker image of my favorite OS, load it with my dotfiles, vim plugins, etc. and then pull it down wherever I am.<p>Of course, this means you need Docker running on the machine. I’ve hit a couple of snags with credentials and key files, but I just end up mounting them as a volume or environment variable.<p>I followed this guide I found on HN, and it’s worked incredibly well.<p><a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=26669474" rel="nofollow">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=26669474</a>
ameliusabout 4 years ago
Why not store everything in a Git repo, and symlink the dotfiles to the right place?
评论 #27139897 未加载
johnisgoodabout 4 years ago
I manage them and stuff installed manually with <a href="https:&#x2F;&#x2F;zolk3ri.name&#x2F;cgit&#x2F;zpkg&#x2F;" rel="nofollow">https:&#x2F;&#x2F;zolk3ri.name&#x2F;cgit&#x2F;zpkg&#x2F;</a>.