Live data from Hacker News

Dotfiles: Unofficial Guide to Dotfiles on GitHub

dotfiles.github.io

11–20 of 74 posts

Re: Dotfiles: Unofficial Guide to Dotfiles on GitHub

#13
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.

This will not handle cases other targets than $HOME. The automatic deletion seems also very risky. In my own script, I move all pre-existing targets to a separate directory, so I can check later.

Re: Dotfiles: Unofficial Guide to Dotfiles on GitHub

#15
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.

This will not handle cases other targets than $HOME. The automatic deletion seems also very risky. In my own script, I move all pre-existing targets to a separate directory, so I can check later.

You can set the source and target directories to whatever you'd like, this is just what I need for my own use. The automatic deletion is for directories, to prevent recursive symlinks. Of course, you can program your own however you wish, maybe add a confirmation step before removing and/or create a backup beforehand.

Re: Dotfiles: Unofficial Guide to Dotfiles on GitHub

#16
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.

Using the GNU stow utility makes this super easy. It even has a --dotfiles flag so you can author your dotfiles as dot-zshrc and when the utility symlinks it, it will be .zshrc. Makes it nice so your source files are not hidden but the actual dotfiles are (as expected).

Re: Dotfiles: Unofficial Guide to Dotfiles on GitHub

#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.

Re: Dotfiles: Unofficial Guide to Dotfiles on GitHub

#18
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 use stow, which has some nice advantages vs managing symlinks yourself

https://brandon.invergo.net/news/2012-05-26-using-gnu-stow-t...

Re: Dotfiles: Unofficial Guide to Dotfiles on GitHub

#19
post #16
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.

Using the GNU stow utility makes this super easy. It even has a --dotfiles flag so you can author your dotfiles as dot-zshrc and when the utility symlinks it, it will be .zshrc. Makes it nice so your source files are not hidden but the actual dotfiles are (as expected).

Although GNU stow is very interesting, I like this simple script because it has no external dependencies. Stow is not available on macos by default, for example.

Re: Dotfiles: Unofficial Guide to Dotfiles on GitHub

#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

Post reply on HN