Mac Development Setup for Hobbits

Git

Yes, our white knight, our savior is here: Git.

What's a developer without Git? To install, simply run:

$ brew install git

Now type:

$ which git

... oops! looks like our OS is still using the pre-installed version of git.To fix it you need to tell bash to look in the correct path for the Homebrew managed version of Git.

Just execute this command and then restart terminal:

$ echo 'export PATH="/usr/local/bin:/usr/local/sbin:~/bin:$PATH"' >> ~/.zshrc

Take note that this command is for zsh shell.

Git config

$ git config --global color.ui true
$ git config --global core.editor "atom --wait"

# Github settings
$ git config --global user.name "YOUR NAME"
$ git config --global user.email "YOUR EMAIL"
$ git config --global github.user github_user
$ git config --global github.token github_token

# To use the recommended HTTPS method
$ git config --global credential.helper osxkeychain

Hub

hub is a command line tool that wraps git in order to extend it with extra features and commands that make working with GitHub easier. To install it run:

brew install hub

Add the following lines to your .zshrc file and source it:

# Using hub feels best when it's aliased as git. 
# Your normal git commands will all work, hub merely adds some sugar.
eval "$(hub alias -s)"

Now we make HTTPS the default protocol for GitHub repositories:

git config --global hub.protocol https