Dotfiles: Unofficial Guide to Dotfiles on GitHub

stefankuehnel | 229 points

This site seems much more like an some of the awesome-<insert tech here> repositories on github than a guide. Although it does give some extra information on the packages.

To not make it took negative. I personally use Chezmoi, which I've been super happy with. The ability to maintain files in a central repository and then pull them into the file system on an update is quite nice.

You can handle merge conflicts and whatnot between your local copy and the upstream dot files. You can opt your files into using go templates in your files which is useful when I need to maintain differences in configs between mac and linux, or in general for just storing secrets out of your dotfiles.

There are some small annoyances but overall it is the only dotfile manager, I've managed to stick with.

kjuulh | 12 days ago

All you need is a symlink script that symlinks files in ~ to ~/path/to/your/dotfiles

https://github.com/pprotas/dotfiles/blob/main/symlink.sh

That's it.

pprotas | 12 days ago

I've been bikeshedding with dotfiles for 20 years and ended up with Chezmoi[0] in the end.

It came down to the fact that it's easy to install and easy to bootstrap as long as your dotfiles are in a public Github repo. It also integrates with a bunch of password managers to grab any secrets you might need in addition.

I use the "run_onchange_install-packages.sh.tmpl" to install basic packages to computers I bootstrap chezmoi on, it adapts based on the operating system using chezmoi's templating system[1]

It takes a few tries to remember the flow of "chezmoi add"ing a file after editing it so that you can push it to Github. After that it's just a matter of chezmoi update on your other computers to bring them up to date.

For .gitconfig I use a .gitconfig.local file on my work computer to override my personal credentials and not have to mess with templating the file.

[0] https://www.chezmoi.io [1] https://www.chezmoi.io/user-guide/advanced/install-packages-...

theshrike79 | 12 days ago

just setup a bare repo and call it a day.

https://www.atlassian.com/git/tutorials/dotfiles

original thread on HN: https://news.ycombinator.com/item?id=11070797

josephd79 | 12 days ago

For me, I have found nix home manager to be the most effective solution for managing my dotfiles.

The migration process was easy, and I was able to use it to replace my sim link script with it's file directives.

It also integrates well with my Nixos Systems.

LorenzoGood | 12 days ago

I started managing my dotfiles in git and followed the pattern I found in Anders Knudsen's repository below. The most painful thing has been coming up with config that works across Linux and MacOS, but that's been chosen pain that can easily be avoided.

https://github.com/andersix/dotfiles

low_key | 12 days ago

Symlinks and Git. A remote like GitHub is then a minor bonus.

I didn’t store my dotfiles on GitHub because they didn’t used to have free private repositories. (Why would I share my dotfiles?)

keybored | 12 days ago

Gnu stow has finally been updated to fix a long standing issue so I can once again wholeheartedly recommend it again! It’s lightweight and uses symlinks. Last I checked, chezmoi has a symlink mode but it’s a bit worse.

diego898 | 12 days ago

I'm currently using a git based approach for my dotfiles, similar to the one notes here[1]. I've got one significant change, though: All my dotfile management works over my cfg[2] script that helps me maintain a main branch for dotfiles for all machines and then branches that branch off of that main like 'main.arch.MACHINE_NAME' that are merged like a waterfall during sync (main -[merge]-> main.arch -[merge]-> main.arch.MACHINE_NAME). (I can also cherry pick up the waterfall)

[1]: https://www.atlassian.com/git/tutorials/dotfiles [2]: https://gist.github.com/tionis/a0f23a7a33b0e289f1b03cc6ff503...

tionis | 12 days ago

the ultimate bikeshedding with dotfiles is home-manager with nix, an infinite cacophony of deep pain and enlightened pleasure

gbrindisi | 12 days ago

I'm using yadm for some years now, which works really well:

https://github.com/TheLocehiliosan/yadm

botanical | 12 days ago

I highly recommend dotter, especially if your dotfiles have variation from machine to machine and or if you don't need all of them at a given time. It's pretty simple and lightweight

https://github.com/SuperCuber/dotter

travis51 | 12 days ago

I've had really good luck with vcsh and git-crypt. vcsh can be a little awkward to use because git commands need to be scoped to the vcsh project, but you get used to it. I like having separate git repos for separate roles (e.g., fish-common, fish-personal, fish-work). Then, depending on what I'm doing on a particular machine I can pull in just the roles I need. It may seem like overkill, but I've found it very helpful in sharing my dev config without pulling personal stuff onto a work machine, vice versa.

git-crypt allows me to protect sensitive files while still tracking them in a git repo. I don't think I'd rely on it for shared projects, but it works well for me.

nirvdrum | 12 days ago

> Submodules make managing dotfile dependencies so much easier.

I'm impressed by the dedication of anyone who has enough dotfile config to use a submodule!

I still like Vorta for dotfiles, just because it's trivial to set up and only uses tools I already use for other things. Most of the dotfiles I want to back up have secrets, so GitHub isn't really an option.

SyncThing seems like it could work well for dotfiles too, with some kind of frontend that copied stuff to a sync folder.

eternityforest | 10 days ago
bbor | 12 days ago

This one's my favorite - has been working reliably and with barely any intervention for years now: https://github.com/andsens/homeshick

My own dotfiles: https://github.com/epiccoleman/dotfiles

epiccoleman | 12 days ago

1. sudo apt/dnf/zypper install stow

2. man stow

3. git init ~/dotfiles

have at'er

throwaway918274 | 12 days ago

Previous discussion: https://news.ycombinator.com/item?id=32632533 (256 points | Aug 28, 2022 | 61 comments)

asicsp | 12 days ago

Am I missing something or is the use of "GitHub" weird here? Are they GitHub employees? None of the creators seem associated with GitHub. They're _users_ of GitHub, nothing more.

sevagh | 12 days ago

Just use your home folder as a git repo, rename .git, create alias "githome" to git cli pointing to that directory and viola, you have all you need.

mehdix | 12 days ago

What I see is a mishmash of information.

Frictus | 12 days ago

All you really need is one alias.

alias homegit="git --work-tree=$HOME --git-dir=$HOME/.dotfiles.git"

shizzy0 | 12 days ago

This seems overwhelming. A bunch of paths to go down. No clear recommendation.

ElijahLynn | 11 days ago