News for hackers. Stuff that matters.
Re:Show HN: Manage Dotfiles with Stow by pcr910303 on Sunday December 01, 2019 @07:59AM (#21675257)
_The_ method to manage dotfiles is to use git bare repos. [0-1] Its the ideal method as:

* It doesn’t require any configuration except for a ‘git init’ once & an alias (no symlinks, no b.s.)

* Files are version-controlled

* It’s unintrusive & universal: Because it doesn’t move any files or do anything special, there’s no surprising behavior, and you can try out a few files & stop using it with an rm -rf

* and on and on...

I strongly recommend eveybody trying out, no meed for configuration/mapping, and it’s easy to try out.

[0]: https://news.ycombinator.com/item?id=11071754

[1]: https://www.atlassian.com/git/tutorials/dotfiles

Re:Show HN: Manage Dotfiles with Stow by _frkl on Sunday December 01, 2019 @07:05PM (#21678731)
Bare repos are fine, but I don't think it is the method to manage dotfiles, the other approaches people use, stow among them, have their merits too. For me a bare repo never really worked that well. I use different dotfiles "profiles" that I mix and match for different environments (remote server, docker container, dev workstation, ...) and situations (terminal, xorg, dev, testing, etc.). I found a bare repo less than ideal for this, personally. It's perfectly fine for simple setups, granted.
Re:Show HN: Manage Dotfiles with Stow by anishathalye on Sunday December 01, 2019 @08:30AM (#21675387)
I think one reason some people prefer symbolic links over directly managing $HOME with git is that there's less chance that things go wrong due to a bad accidental git command. For example, `git clean` (with the appropriate arguments, e.g. '-fdx') could delete all non-dotfiles from all of $HOME.

Admittedly, the chance of this happening does seem much lower when the git directory is in e.g. '~/.cfg/' while the work tree is $HOME, as the linked article proposes, than when it's set up with just a `git init` run in $HOME (because a `git clean` in a non-git-repository directory somewhere under $HOME won't cause any problems, because there will be no '--work-tree' argument). Still, at least to me, the symlink approach feels more comfortable.

I wonder, does anyone else have other reasons to prefer symbolic links?

Re:Show HN: Manage Dotfiles with Stow by saagarjha on Sunday December 01, 2019 @08:23AM (#21675355)
I can't use this because I'd like to be able to put files outside of $HOME :(
Re:Show HN: Manage Dotfiles with Stow by mping on Monday December 02, 2019 @07:28AM (#21681793)
I prefer dotfiles too, I recently built a new machine and was able to configure most of stuff just by using dotfiles.

By carefully managing scripts (mostly .zshrc) I can even use the same dotfiles between mac and linux.

Re:Show HN: Manage Dotfiles with Stow by Flenser on Monday December 02, 2019 @02:36PM (#21685972)
> no surprising behavior

What surprising behavior does it avoid?

Symlinks breaking perhaps? Anything else?

Re:Show HN: Manage Dotfiles with Stow by karasmith on Tuesday December 03, 2019 @03:18AM (#21690749)
Does it work for all kinds of files ???
Re:Show HN: Manage Dotfiles with Stow by codejamninja on Sunday December 01, 2019 @08:08AM (#21675296)
that’s the way everyone first tries it
Re:Show HN: Manage Dotfiles with Stow by saagarjha on Sunday December 01, 2019 @08:12AM (#21675320)
It is not.