Problem upgrading Git using Homebrew

If you're having problem with upgrading your Git after upgrading your OSX to Yosemite please follow below what I did to make it work.

This is the error I've got when upgrading my git using Homebrew.

Error: The `brew link` step did not complete successfully
The formula built, but is not symlinked into /usr/local
Here is the solution:

1) First you need to uninstall your current git program

$ brew uninstall --force git

2) change permission of your /usr/local

$ sudo chown -R $USER:admin /usr/local

3) Install git using Homebrew

$ brew install git

4) Check the version of git to know if you're successful in your upgrade.

$ git --version

Make sure you have the right version.