Disclaimer: the title is slightly hyperbolic, there are other proven solutions to the problem. I do think the technique below is very elegant though.
Recently I read about this amazing technique in an Hacker News thread on people's solutions to store their dotfiles. User
StreakyCobra showed his elegant setup and ... It made so much sense! I am in the process of switching my own system to the same technique. The only pre-requisite is to install Git.
In his words the technique below requires:
No extra tooling, no symlinks, files are tracked on a version control system, you can use different branches for different computers, you can replicate you configuration easily on new installation.
The technique consists in storing a Git bare repository in a "side" folder (like
$HOME/.myconfig) using a specially crafted alias so that commands are run against that repository and not the usual
.git local folder, which would interfere with any other Git repositories around.