I use a Git repository to maintain my dotfiles (vimrc, zshrc, tmux.conf, etc.). As I've two different operating systems (OSX at home and Ubuntu at work) I've dedicated a branch for each system. This results in different versions of dotfiles as OSs are not used to use the same tools/libraries to do a job. This makes the maintenance of dotfiles hard for all the branches (diverged dotfiles). I was thinking if there could be a better strategy for this. Maybe to include system specific dotfiles in another file and include them in dotfiles.
In other words, I'm looking for a cross-platform strategy for maintaining dotfiles for computers with different OS.
Thanks in advance for any help