通过brew安装git,命令如下:
brew install git
安装过程:
==> Downloading https://homebrew.bintray.com/bottles/git-2.5.0.yosemite.bottle.t
######################################################################## 100.0%
==> Pouring git-2.5.0.yosemite.bottle.tar.gz
==> Caveats
The OS X keychain credential helper has been installed to:
/usr/local/bin/git-credential-osxkeychain
The "contrib" directory has been installed to:
/usr/local/share/git-core/contrib
Bash completion has been installed to:
/usr/local/etc/bash_completion.d
zsh completion has been installed to:
/usr/local/share/zsh/site-functions
==> Summary
/usr/local/Cellar/git/2.5.0: 1383 files, 32M
检测git是否安装成功:
git --version 显示当前git的版本,我的2.5.0
which git显示当前git的路径,一般在/usr/local/Cellar/git
安装成功:
brew install gcc
==> Installing dependencies for gcc: gmp, mpfr, libmpc, isl
==> Installing gcc dependency: gmp
==> Downloading https://homebrew.bintray.com/bottles/gmp-6.0.0a.yosemite.bottle.
######################################################################## 100.0%
==> Pouring gmp-6.0.0a.yosemite.bottle.tar.gz
�� /usr/local/Cellar/gmp/6.0.0a: 15 files, 3.2M
==> Installing gcc dependency: mpfr
==> Downloading https://homebrew.bintray.com/bottles/mpfr-3.1.3.yosemite.bottle.
######################################################################## 100.0%
==> Pouring mpfr-3.1.3.yosemite.bottle.tar.gz
�� /usr/local/Cellar/mpfr/3.1.3: 24 files, 3.6M
==> Installing gcc dependency: libmpc
==> Downloading https://homebrew.bintray.com/bottles/libmpc-1.0.3.yosemite.bottl
######################################################################## 100.0%
==> Pouring libmpc-1.0.3.yosemite.bottle.tar.gz
�� /usr/local/Cellar/libmpc/1.0.3: 10 files, 380K
==> Installing gcc dependency: isl
==> Downloading https://homebrew.bintray.com/bottles/isl-0.14.1.yosemite.bottle.
######################################################################## 100.0%
==> Pouring isl-0.14.1.yosemite.bottle.3.tar.gz
�� /usr/local/Cellar/isl/0.14.1: 68 files, 3.2M
==> Installing gcc
==> Downloading https://homebrew.bintray.com/bottles/gcc-5.2.0.yosemite.bottle.t
##################################### 52.0%
curl: (56) SSLRead() return error -9806
Error: Failed to download resource "gcc"
Download failed: https://homebrew.bintray.com/bottles/gcc-5.2.0.yosemite.bottle.tar.gz
Warning: Bottle installation failed: building from source.
==> Downloading http://ftpmirror.gnu.org/gcc/gcc-5.2.0/gcc-5.2.0.tar.bz2
==> Downloading from http://mirror.hust.edu.cn/gnu/gcc/gcc-5.2.0/gcc-5.2.0.tar.b
###################### 30.8%
curl: (56) Recv failure: Operation timed out
Trying a mirror...
==> Downloading https://ftp.gnu.org/gnu/gcc/gcc-5.2.0/gcc-5.2.0.tar.bz2
################################### 49.9%
curl: (56) SSLRead() return error -36
Error: Failed to download resource "gcc"
Download failed: https://ftp.gnu.org/gnu/gcc/gcc-5.2.0/gcc-5.2.0.tar.bz2
liuyy-iMac:2.5.0 liuyy$ brew install gcc
==> Downloading https://homebrew.bintray.com/bottles/gcc-5.2.0.yosemite.bottle.t
###################################### 54.1%
curl: (56) SSLRead() return error -9806
Error: Failed to download resource "gcc"
Download failed: https://homebrew.bintray.com/bottles/gcc-5.2.0.yosemite.bottle.tar.gz
Warning: Bottle installation failed: building from source.
==> Downloading http://ftpmirror.gnu.org/gcc/gcc-5.2.0/gcc-5.2.0.tar.bz2
==> Downloading from http://mirror.hust.edu.cn/gnu/gcc/gcc-5.2.0/gcc-5.2.0.tar.b
#################################### 50.0%
curl: (56) Recv failure: Operation timed out
Trying a mirror...
==> Downloading https://ftp.gnu.org/gnu/gcc/gcc-5.2.0/gcc-5.2.0.tar.bz2
#################################### 50.4%
curl: (56) SSLRead() return error -36
Error: Failed to download resource "gcc"
Download failed: https://ftp.gnu.org/gnu/gcc/gcc-5.2.0/gcc-5.2.0.tar.bz2
liuyy-iMac:2.5.0 liuyy$ brew install gcc
==> Downloading https://homebrew.bintray.com/bottles/gcc-5.2.0.yosemite.bottle.t
######################################### 57.2%
curl: (56) SSLRead() return error -9806
Error: Failed to download resource "gcc"
Download failed: https://homebrew.bintray.com/bottles/gcc-5.2.0.yosemite.bottle.tar.gz
Warning: Bottle installation failed: building from source.
==> Downloading http://ftpmirror.gnu.org/gcc/gcc-5.2.0/gcc-5.2.0.tar.bz2
==> Downloading from http://mirror.hust.edu.cn/gnu/gcc/gcc-5.2.0/gcc-5.2.0.tar.b
##################################### 51.5%
curl: (56) Recv failure: Operation timed out
Trying a mirror...
==> Downloading https://ftp.gnu.org/gnu/gcc/gcc-5.2.0/gcc-5.2.0.tar.bz2
##################################### 51.6%
curl: (56) SSLRead() return error -36
Error: Failed to download resource "gcc"
Download failed: https://ftp.gnu.org/gnu/gcc/gcc-5.2.0/gcc-5.2.0.tar.bz2
liuyy-iMac:2.5.0 liuyy$ brew install gcc
==> Downloading https://homebrew.bintray.com/bottles/gcc-5.2.0.yosemite.bottle.t
######################################################################## 100.0%
==> Pouring gcc-5.2.0.yosemite.bottle.tar.gz
==> Caveats
GCC has been built with multilib support. Notably, OpenMP may not work:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=60670
If you need OpenMP support you may want to
brew reinstall gcc --without-multilib
==> Summary
�� /usr/local/Cellar/gcc/5.2.0: 1353 files, 248M