DEV Community

rounakcodes
rounakcodes

Posted on • Edited on

Use Symbolic Links to version control your config files

Coming from Windows based OS, I thought of symbolic links in Unix based OS as a way of creating shortcuts like "Create a Desktop shortcut for ..." and so I never paid much attention to it.

I have now (15 years late) discovered its value.

Usually, you have your configuration (dotfiles) files for shell, text editors, git etc in your home directory (or ~/.config).
It is not convenient to version control your home directory to backup some of these config files.

The solution is to create symbolic links. Create any directory like ~/.dotfiles and move all the config files from your home directory to ~/.dotfiles. Then create a symbolic link in the home directory. Now you can version control ~/.dotfiles with ease.

I wrote this short article just to draw attention to the value of symbolic links.
For implementation details, you can watch these excellent videos which also introduces GNU Stow to avoid the pain of creating symbolic links manually.

  1. Create dotfiles folder and use symoblic links
  2. GNU Stow

Top comments (0)