Sync your dotfiles with GitHub

I'm tired of trying to keep my config files homogeneous between my linux-notebook and my mac mini, so I decided to store them in 'the cloud'. I chose GitHub because I'm learning Git and it has a neat web interface.

Step 1
Create dotfiles dir in my linux notebook, as the most recent configs reside there

benoror@gateway:~$ mkdir ~/dotfiles
benoror@gateway:~$ mkdir ~/dotfiles
benoror@gateway:~$ mv .bashrc ~/dotfiles/
benoror@gateway:~$ mv .vimrc ~/dotfiles/
benoror@gateway:~$ mv .vim ~/dotfiles/
(... ... ...)
benoror@gateway:~$ mv .ssh ~/dotfiles/

Step 2
Link those files back to my home dir

benoror@gateway:~$ ls -Ad /dotfiles/ | xargs -I _ ln -s _

Step 3
Create a neat readme file and make git ignore those sensitive files!

benoror@gateway:~/dotfiles/$ echo "Welcome to my public dotfiles" > README
benoror@gateway:~/dotfiles/$ echo ".secret" >> .gitignore
(...)
benoror@gateway:~/dotfiles/$ echo ".ssh/*" >> .gitignore

Step 4
Download Git and confiigure it

benoror@gateway:~/dotfiles/$ git config --global user.name "Benji Orozco" benoror@gateway:~/dotfiles/$ git config --global user.email benoror@gmail.com

Step 5
Sign-up at GitHub, and create a repo called 'dotfiles'. Follow the instructions to include your dsa-key, it's straight forward. Then create the repo locally and push it to your github:

benoror@gateway:~/dotfiles/$ git init benoror@gateway:~/dotfiles/$ git add .
benoror@gateway:~/dotfiles/$ git status
benoror@gateway:~/dotfiles/$ git commit -a -m 'first commit'
benoror@gateway:~/dotfiles/$ git remote add origin git@github.com:benoror/dotfiles.git benoror@gateway:~/dotfiles/$ git push origin master

That's It

Next article: Cloning Git Repos and mixing them with Dropbox