安装brew
$ git config --global --unset http.proxy
$ git config --global --unset https.proxy
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
安装Git
$ brew install git
git --version
配置 Git(如果尚未配置)
在使用 Git 之前,你需要设置你的用户名和电子邮件地址,因为这些信息会被记录在你的提交(commit)中。在终端执行以下命令:
git config --global user.name "你的名字"
git config --global user.email "你的邮箱"
替换 你的名字
和 你的邮箱
为你的实际信息。