The recommended way of syncing these dotfiles is using GNU-stow. For Debian-like distributions, you would thus sync with your home directory as follows:
sudo apt install stow
stow vim
-
Clone the repository into $HOME/.dotfiles. That way, it is out of the way for most operations but since it is a subdirectory of $HOME, the paths generated by Stow will work as expected. More about this later.
-
For every program that you want to manage, create a separate subdirectory in the dotfiles repository. Inside this subdirectory, create as many directories as needed in order to replicate the file location relative to $HOME. For example, since vim, the best editor in the world, uses $HOME/.vim/spell to store its spellchecker files, you would place the configuration in $HOME/.dotfiles/vim/.vim/spell. This might look strange at first glance, so just think of the dotfiles repository reflecting all paths relative to your home directory.
-
To activate a configuration, you go into your dotfiles repository, and issue stow vim, for example. This makes Stow look for all files in the vim/ subfolder; each of them will be propagated to your home directory. Of course, Stow will not overwrite any file that already exist there, so after making a backup of them, you can safely delete them and make Stow do the rest.
See: dotfiles_stow