Hacker News new | ask | show | jobs
by _fat_santa 1494 days ago
I was looking at someone's dotfiles on Github a while back and they employed this method. Essentially they made their entire home directory a git repo but used gitignore to ignore everything but the dotfiles they wanted to backup. It was a pretty nifty setup
3 comments

A nifty setup until you run a git command like `git clean -fx` somewhere under your home directory that you think is another git directory but isn't. Happy restore from backups time.
I feel obligated to point out vcsh [1], which is likely already packaged for your operating system.

[1] https://github.com/RichiH/vcsh

The main selling point is that you can set up various git repos for different things. I have one for SSH keys (and no, that does not get pushed anywhere except to my own private server), VIM, neovim, bash, and 'other' (for misc config files like .dir_colors, .gitconfig, etc.).

Another option is to clone the dotfiles repo to your workspace. Then create symbolic links in your home directory. Like:

ln -fs ~/workspace/dotfiles/vimrc ~/.vimrc