John Tomson John Tomson - 4 months ago 25
Git Question

Adding your .vim ~/.vimrc to github (aka dot files)

I have seen a few people that have git repos with their dot files. I'm wondering if they just

cd ~/
git init
git add .vimrc
// etc


? And then that's how they keep it up to date? Or do they probably make copies and sync them?

What strategy do you guys recommend or use? Mostly don't wanna commit and push my entire ~/

Thanks

Answer

Making a git repository of your home is probably a bad idea (you would be spending more time creating your .gitignore file than on doing what you really want to do).

I suggest using a separate git directory for your dotfiles (eg. ~/git/dotfiles) and them making symlinks to your home (eg. ln -s ~/git/dotfiles/.vim ~/.vim, etc.).

If you can't be bothered creating symlinks manually each time you want to install your dotfiles somewhere, you can use a script like the following one: https://github.com/sitaktif/dotfiles/blob/master/bin/create-symlinks (it uses https://github.com/sitaktif/dotfiles/blob/master/CONFIG as the configuration).