Managing user configuration files across multiple computers

Viewed 10271

I commonly work on multiple computers. I have various configuration files, eg, .bashrc, .gitconfig, .irbrc, .vimrc and configuration folders, eg, .vim/ that contain valuable customizations. Sometimes I want small variations in configuration between the different computers.

I want to use version control to manage these different files.

  • do others use version control to manage their configuration files?
  • what are some hints that might make this easier?
  • what's the most elegant way of dealing with variations between the computers?
  • I'm comfortable with git; any other suggestions?
12 Answers

Now there is also vcsh

From the README:

vcsh - manage config files in $HOME via fake bare git repositories

[...]

vcsh allows you to have several git repositories, all maintaining their working trees in $HOME without clobbering each other. That, in turn, means you can have one repository per config set (zsh, vim, ssh, etc), picking and choosing which configs you want to use on which machine.

Works perfectly, but may be a bit daunting if you are not an experienced git user.

Most of these answer address sync, but not how to tailor the files for the specific device. filetailor is an open-source Python program for this exact issue. Based on a YAML configuration file, it can make small changes to the files using device-specific variables or using device-specific comments in the files. Then, use another program such as Syncthing or Git to transfer the files.

For example, the following line would be commented out on every device except the one with hostname device1.

alias MYHOME='/home/dev1home/' #{filetailor device1}

Disclaimer: I had this same issue and made filetailor to solve it.

Related