Live data from Hacker News

Way to store your dotfiles: A bare Git repository (2016)

atlassian.com

31–40 of 60 posts

Re: Way to store your dotfiles: A bare Git repository (2016)

#31
post #5

Earlier quoted context omitted.

I use stow. But honestly, I don't think it's better than git.

It's orthogonal, isn't it? You keep your dotfiles in a repo, then have stow "install" the checkout/clone thereof. EDIT: Also on stow - I tried it a couple times and it never seemed flexible enough. Can it handle things like keeping ~/.config/nvim and ~/.vim in the same stow directory? (And for that matter, can it link them together? I like having the same config for vim and neovim)

Re: your edit, Yeah it can! Set up a folder, say 'vim' for your example, and then inside of that folder you have a '.vim' file and a '.config/nvim' file.

Then when you run `stow vim` from the parent of the original 'vim' folder it will symlink everything in there to ~.

You can even have more folders that have a '.config/foobar' inside of them, and when you stow those it will all work itself out nicely!

Edit: You can find examples of this in my dotfiles https://github.com/AnthonyWharton/dotfiles/ (I use stow if you didn't guess :P). For example look at the 'i3' folder and the 'polybar' folder, they both add things to '~/.config '

Re: Way to store your dotfiles: A bare Git repository (2016)

#33
post #3

I'm still looking for a good way to I'm using this approach, but looking for a way manage dotfiles for multiple machines. Having separate branches feels clunky, since there is a lot of overlap and tweak may involve making the same tweak on several branches. Any recommendations for managing this situation?

I use https://github.com/thoughtbot/rcm

it's great. It has tags to only pull up specific dotfiles (say for emacs, .config etc), and supports configurations for multiple hosts and multiple source folders.

Re: Way to store your dotfiles: A bare Git repository (2016)

#34

The problem with keeping all dotfiles in a single repo is that if you want to get an older version of one particular dotfile, you'll also be getting older versions of other dotfiles as well. I want every dotfile I use to be independent of the rest and a log that shows changes to just that one dotfile, so I store each of them in separate repos and use GNU Stow[1] to manage them. The above is actually a bit of an overs…

Or you could learn how git already does those things

Re: Way to store your dotfiles: A bare Git repository (2016)

#36

This could lead to a potential security issue. Imagine there's a misconfiguration in your dotfiles -- now it's public.

There's a lot of dotfiles on Github and it doesn't seem to be a problem (Except if you check in private credentials, but that's not a problem unique to dotfiles).

If you rely on your configuration to be secret to be secure it's just security by obscurity and not worth much anyway.

Re: Way to store your dotfiles: A bare Git repository (2016)

#37
It's fair to say that the technique described by SneakyCobra is amazing. I previously used this to manage my own dotfiles but there's still a few problems with SneakyCobra's approach.

* initial setup can be tricky even for experienced users * Incorrect use can potentially destroy your home directory

So, I wrote a little utility call "SDF: Sane dotfile manager" that makes the technique used by SneakyCobra approachable to a complete novice and hence more reliable to use.

You can find the introductory text here (https://shreyanshja.in/blog/sane-dotfiles-management/) And the source code here (https://github.com/shreyanshk/sdf)

Let me know how it works for you. :-)

Re: Way to store your dotfiles: A bare Git repository (2016)

#38
post #36

This could lead to a potential security issue. Imagine there's a misconfiguration in your dotfiles -- now it's public.

There's a lot of dotfiles on Github and it doesn't seem to be a problem (Except if you check in private credentials, but that's not a problem unique to dotfiles). If you rely on your configuration to be secret to be secure it's just security by obscurity and not worth much anyway.

> If you rely on your configuration to be secret to be secure it's just security by obscurity and not worth much anyway.

What I had in mind is that the average person wouldn't be a target, but publicly declaring their security vulnerability would attract attacks they wouldn't receive otherwise.

Re: Way to store your dotfiles: A bare Git repository (2016)

#39
post #29
post #23

I don't understand how the curl http://site.com | bash anti-pattern has become so widespread. Especially with -k.

It originated as a way for people who aren't familiar with CLI to install things. People have now been trained to expect this level of simplicity. I've worked with people that will blindly copy and paste these lines into terminals, having absolutely no idea what they do, and even blindly type in sudo password when prompted. It's basically the worst of all worlds from a security perspective. In my opinion this should…

There's these cautionary tale you might find interesting

https://www.vidarholen.net/contents/blog/?p=746

and seriously just Shellcheck it should be in your repos.

Post reply on HN