Wednesday, July 29, 2009

Host your configuration files on github

My .vimrc and .bashrc is pretty highly customized. As such it doesn't make sense for me to rewrite them on my various machines (laptop + netbook + pc). Even copy and pasting them ain't no fun.

The solution is to host a master copy of these files online. Github is great for that. It offers a free repository that allows you to version your files using git. So I've created a github repository for my config files.


cd ~/apps
mkdir config-files
cd config-files
git init
touch README
git add README
git commit -m 'first commit'
git remote add origin git@github.com:jasonong/config-files.git
git push origin master
cp ~/.bashrc .
cp ~/.vimrc .
git add .
git commit -m 'Added bash and vim config files'
git push origin master

So now that's left is to symlink the actual config files to my local repository.

cd ~
ln -s apps/config-files/.bashrc .bashrc
ln -s apps/config-files/.vimrc .vimrc

So I can do git clone and symlink these config files on my other machines. Best way to synchronize my files and versioning thrown in too!

No comments:

Blog Archive