DEV Community

Discussion on: How do you manage your dotfiles across multiple and/or new developer machines?

Collapse
 
coreyja profile image
Corey Alexander

I put all my dotfiles that I want to share in a public repo that I host on Github

GitHub logo coreyja / dotfiles

My dotfile Repo

Coreyja's dotfiles

My dotfiles!

This started out as a fork from github.com/mathiasbynens/dotfiles but diverged enough that I cut the fork tie at some point.

Notably I run my dotfiles where my homedir is under git, so not aliasing/copying is required or provided here

Here are some blog posts I've written about my dotfiles:

Setup

Doing setup on a new machine so writing some documentation

Using brew installed bash

To update the shell we need to do two things both need root perms:

  • Add $(brew prefix)/bin/bash to /etc/shells so its an allowed shell
  • Run sudo chsh -s "$(brew prefix)/bin/bash" to set it as the default shell for the user



I do something that I think is somewhat unconventional but I really like it! And that is keep my actual home directory under version control. To accomplish this my .gitignore starts with * so that it ignores everything. Then I go in an specifically include files like !file.txt.

This means I don't have to deal with any symlinks or scripts when I pull updates. I also can edit the actual 'live' files and then commit those same files, which makes sharing between machines painless! I've written a few blog posts about my dotfiles!

This second one discusses some recent change to my dotfiles around Homebrew 2

Collapse
 
lostintangent profile image
Jonathan Carter • Edited

It definitely seems like many of the “dot file managers” are simply working around the fact that folks don’t want to make their home directory a Git repo. Have you run into any downsides with this solution? It certainly seems really simple.

Collapse
 
coreyja profile image
Corey Alexander

Not any huge ones, but there are definitely some interesting side effects.

One if that I am always in a git repo now basically, so my bash indicator of if I'm in a git branch is slightly less meaningful
Two some tools (ex: ripgrep) use your .gitignore file as a generic ignore file when searching, so this needs to be worked around. I accomplish this my using something like rg --no-ignore --glob "!.git/*". I find I don't actually run into this too often, as usually I am running rg from within a different project directory, where it's local .gitignore is used so this isn't an issue.

Besides that everything works as expected! I've been doing it for a few years now and really enjoy the setup!