Many user configuration files reside in ~/.*
files and directories. To aid in version controlling and deploying setups on new machines/hosts these can be backed up using a framework known as
There are a number of different tools that aid synchronising dotfiles between systems but I've opted for GNU/Stow as its one of the few that resides in Gentoo's portage and will therefore be updated automatically rather than me having to track (or learn how to automate tracking) of git based tools such as dotgit or Dotsync.
Using GNU/Stow is pretty straight-forward, mv
files under ~/
into their own dotfiles
directory and then stow
them, this will symlink all files in the programmes directory to ~/
$ mkdir -p ~/dotfiles/bash && cd dotfiles/bash $ mv ~/.bash* dotfiles/bash/. $ cd dotfiles $ stow bash $ ls -l ~/.bash* lrwxrwxrwx 1 neil neil 27 Sep 3 19:59 /home/neil/.bash_aliases -> dotfiles/bash/.bash_aliases lrwxrwxrwx 1 neil neil 27 Sep 3 19:59 /home/neil/.bash_history -> dotfiles/bash/.bash_history lrwxrwxrwx 1 neil neil 26 Sep 3 19:59 /home/neil/.bash_logout -> dotfiles/bash/.bash_logout lrwxrwxrwx 1 neil neil 27 Sep 3 19:59 /home/neil/.bash_profile -> dotfiles/bash/.bash_profile lrwxrwxrwx 1 neil neil 21 Sep 3 19:59 /home/neil/.bashrc -> dotfiles/bash/.bashrc
This took me a little trial and error to figure out (probably should have read the manual) but requires making a ~/dotfiles/config/.config
directory and moving files there…
$ mkdir -p ~/dotfiles/config/.config/transmission $ mv ~/.config/transmission/settings.json ~/dotfiles/config/.config/transmission/. $ cd dotfiles $ stow config $ ls -l ~/.config/transmission/settings.json lrwxrwxrwx 1 neil neil 56 Sep 9 20:48 /home/neil/.config/transmission/settings.json -> ../../dotfiles/config/.config/transmission/settings.json
Dotbot simplifies the process of cloning and installing your files on a new system. You should add it as a submodule to your dotfiles
directory. Assuming you have already initialised your ~/dotfiles/
repo then as per the instructions…
cd ~/.dotfiles # replace with the path to your dotfiles git init # initialize repository if needed git submodule add https://github.com/anishathalye/dotbot cp dotbot/tools/git-submodule/install . touch install.conf.yaml git add install.conf.yaml git commit -m "Adding dotbot conf file"
Then modify your install.conf.yaml
(see documentation for details), save and commit changes.