Live data from Hacker News

Dotfiles: Unofficial Guide to Dotfiles on GitHub

dotfiles.github.io

41–50 of 74 posts

Re: Dotfiles: Unofficial Guide to Dotfiles on GitHub

#41
post #20

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

yup, a bare repo. its the easiest way I think.

Re: Dotfiles: Unofficial Guide to Dotfiles on GitHub

#42
post #9

Earlier quoted context omitted.

Seconding Chezmoi, it's what I use, and it works well.

Third here, it's the easiest tool to setup dotfiles that work on machines ranging from RHEL7 to latest MacOS. Haven't dealt with Windows dotfiles though.

Fourthing Chezmoi. I tried so many dotfiles tools and it's the only one that does just enough, gets out of my way, and "just works".

Being able to run `chezmoi diff` and `chezmoi apply` are game changers.

Re: Dotfiles: Unofficial Guide to Dotfiles on GitHub

#43
post #11

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.

I'm sorry, but running `rm -rf ...` in a script against $HOME is a bit too reckless for me.

Maybe you haven't lost data from this yet, but this is where Chezmoi has nice guardrails and protects against, e.g., modifications or additions accidentally being made to $HOME instead of the dotfiles dir, which look like they would be silently blown out by your current process.

Just my 2¢ from someone who used to do it this way and lost data because of it.

Re: Dotfiles: Unofficial Guide to Dotfiles on GitHub

#44
post #11

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.

Sure, maybe. Though eventually one may find lots of edge cases. What about files in the root that get deleted? What about programs that put wanted state within config dirs? What about programs that ignore symlinked files? What about when you’re hacking on your dotfiles and break everything because the active config is the config being edited? What about when you need to vary based on system? What about… I mean, yea,…

Similar experience here, like: What about when your editor is set to auto save when unfocusing a tab or window and saves while you were mid-edit on your dotfiles and now every new shell is crashing? etc etc

Re: Dotfiles: Unofficial Guide to Dotfiles on GitHub

#46
post #31
post #7

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.

I guess you're referring to this ? https://github.com/aspiers/stow/issues/65

Sorry - should have been specific in top-level comment. This one: https://github.com/aspiers/stow/issues/33

Re: Dotfiles: Unofficial Guide to Dotfiles on GitHub

#47
post #17
post #7

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.

Curious what the issue you were running into was? I’ve been using stow for my dotfiles for at least 8 years now and have been loving it the whole time.

Sorry - should have been specific in top-level comment. I was referring to this one: https://github.com/aspiers/stow/issues/33

Basically, the --dotfiles option was not working with directories so you had to have things that look like this: lazygit/.config/lazygit and now it looks like: lazygit/dot-config/lazygit.

Really a small issue that bugged me forever - shouldn't have made it seem like it was core a problem with stow!

Re: Dotfiles: Unofficial Guide to Dotfiles on GitHub

#48
post #21
post #7

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.

What's the issue? I've been using stow for a decade now and can't recall ever running into problems

Sorry - should have been specific in top-level comment (cant edit now). I was referring to this one: https://github.com/aspiers/stow/issues/33

Basically, the --dotfiles option was not working with directories so you had to have things that look like this: lazygit/.config/lazygit and now it looks like: lazygit/dot-config/lazygit.

Really a small issue that bugged me forever - shouldn't have made it seem like it was core a problem with stow!

Re: Dotfiles: Unofficial Guide to Dotfiles on GitHub

#49
post #20

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

This method, using a bare git repo, is really an elegant, efficient, and easy way to manage one's dotfiles.

In the end, how you do it is personal pref. I liken it to editor wars, vim vs emacs, etc. What works for me, may not work for you.

PS: these are my dotfiles (link is my repo), and I've used this method for some 5 plus yrs now and it works well for me. I really like how easy it is to spool up a new linux instance and have my config ready to go in mere seconds.

I've not used branches yet, for different OS'en, so my zshrc and bashrc have conditional checks for OS. I will be looking at using branches in the future since it does sound like it would make shell rc files cleaner.

Re: Dotfiles: Unofficial Guide to Dotfiles on GitHub

#50
post #11

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.

I think I'm the only person insane enough to use a makefile for this.

https://github.com/matheusmoreira/.files/blob/master/GNUmake...

https://www.matheusmoreira.com/articles/managing-dotfiles-wi...

It even supports the XDG stuff as well as variables like GNUPGHOME.

Post reply on HN