Http://book.51cto.com/art/201107/278761.htm
3.2.3 Installing Git using Homebrew
Mac OS X has several package managers for managing the installation and upgrade of some open source software on Mac OS X. There are traditional macports, Fink, and a much simpler and easier-to-use Homebrew③. Here's how to install Git with the Homebrew Package Manager, which is compiled with the source package.
Homebrew is developed in the Ruby language to support the deployment and management of thousands of open source software in Mac OS x. The Homebrew project is hosted on Github with the URL: https://github.com/mxcl/homebrew.
The first is to install Homebrew and execute the following command:
- $ ruby-e \
- "$ (Curl-fssl https://gist.github.com/
RAW/323731/INSTALL_HOMEBREW.RB) "
After the installation is complete, Homebrew's main program is installed in/usr/local/bin/brew and the installation instructions for all software supported by Homebrew are saved under directory/usr/local/library/formula/.
Execute the following command to install Git via homebrew.
- $ Brew Install Git
With Homebrew installation, Git is installed in/usr/local/cellar/git/<version>/, and the executable program automatically creates symbolic connections in the/usr/local/bin directory, which can be accessed directly from the terminal program.
The Brew List command allows you to view the installed open source packages.
- $ brew List
- Git
You can also view the detailed path and installation content for a package installation.
- $ brew List git
- /usr/local/cellar/git/1.7.4.1/bin/gitk
- ...
Mac Homebrew Installation