Live data from Hacker News

Unofficial guide to dotfiles on GitHub

dotfiles.github.io

31–40 of 65 posts

Re: Unofficial guide to dotfiles on GitHub

#31
It took me 20 years to have an important realization about version controlled dotfiles: what I wanted to do was manage a set of sensible, personalized, non-standard behaviours for each tool I used, and have a way of distributing those across systems.

What I didn’t need at all, after all, was anything that installed different things on different hosts or classes of hosts.

Luckily, every tool I want to configure has a config file option to include another file, so I have a working copy of my version controlled defaults here:

  ~/.config/defaults
…and a one time installation script that makes various tool’s config files look like this:

  # begin defaults
  source ~/.config/defaults/tool.conf
  # end defaults
  
  local specific config here
I am quite happy managing the local bits by editing files on local machines. All my configuration stuff splits into either “used everywhere” or “used just on this one host”, so that makes it easier.

As soon as I figured this out I had to pinch myself as to why it had taken so long to come up with this idea.

Re: Unofficial guide to dotfiles on GitHub

#32
A few years ago I spent some time developing my own solution to this, which I published on GitHub. I drew inspiration from the best dotfiles managers at the time, but I found deficiencies in all of them which is why I made my own. Basically: no configuration file, uses symlinks and not copies or templates, and can clean up files after you remove them. The result is dfm [0]. I talk more about the differences from other high-quality projects in the README. If you like DFM, I’d appreciate a star on GitHub so that I can hit 100 to qualify to be listed on the dotfiles.github.io list :)

[0] https://github.com/cgamesplay/dfm

Re: Unofficial guide to dotfiles on GitHub

#33
post #4

tl;dr: Create a .gitignore in your ~ with an asterisk on the first line and `!.dotfilename` on subsequent lines; the asterisk means Git will ignore everything, and the ! means Git will un-ignore that specific file or directory. (Be sure to include the .gitignore file itself.) Use Git as normal and push. To deploy on another machine/account, the easiest method is to check out as normal into a temporary directory, then…

git config status.showUntrackedFiles no

Re: Unofficial guide to dotfiles on GitHub

#34
post #4

tl;dr: Create a .gitignore in your ~ with an asterisk on the first line and `!.dotfilename` on subsequent lines; the asterisk means Git will ignore everything, and the ! means Git will un-ignore that specific file or directory. (Be sure to include the .gitignore file itself.) Use Git as normal and push. To deploy on another machine/account, the easiest method is to check out as normal into a temporary directory, then…

Don't track your home directory with Git if you have a habit of using git clean -xdf. Speaking from a bad experience.

Re: Unofficial guide to dotfiles on GitHub

#35
This is fascinating to me. I have been a unix user since 1994 and I have carried my dotfiles around with me. I almost never edit them. Things like "oh-my-zsh" just look to me like supply chain attacks as a service. What is the benefit of these dotfile schemes?

Re: Unofficial guide to dotfiles on GitHub

#37
My pick is yadm - clean way to setup working environment on any host any *nix-like OS and bootstrap it in seconds. password-store (plus yubikey) organically complements it with simple and effective way to access secrets on any host. However I'm using private gitea instance to store repos for both. Just because. :)

Re: Unofficial guide to dotfiles on GitHub

#38
post #35

This is fascinating to me. I have been a unix user since 1994 and I have carried my dotfiles around with me. I almost never edit them. Things like "oh-my-zsh" just look to me like supply chain attacks as a service. What is the benefit of these dotfile schemes?

> What is the benefit of these dotfile schemes?

Not everyone has the time to create their own custom dotfiles.

Some just want sane and beautiful terminal defaults.

Re: Unofficial guide to dotfiles on GitHub

#40
post #24
post #2

[This] way (linked from the tutorials section of the page) is a great way to version your dotfiles without symlinks or installer scripts. [This]: https://www.atlassian.com/git/tutorials/dotfiles

I love the atlassian method for dotfiles. I have been using for a few years now and currently stored on my private gitea server. I also create a branch for each variation, linux, macOS, macOS arm, windows. Basically they’re the same but they all have slightly different things I cannot use universally.

I had different branches for different machines too in the past but it felt very inefficient to me. The configuration was the same for 99% and for the last 1% I had to manually copy stuff back and forth. At the moment, I just try to use tools that allow me to have different configurations for different hostnames or OSs but maybe I should look into one of the fancier dotfile managers…
Post reply on HN