mac安装git

mac2022-06-30  26

1.安装HomeBrow,访问网址 https://brew.sh/index_zh-cn 安装命令如下:

/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

2.使用brow安装git

#更新软件包 brew update brew upgrade #安装 Git brew install git

3.通过安装日志可以发现git安装在:

/usr/local/Cellar/git/2.23.0_1/bin

4.将git命令添加到环境变量中

echo 'export PATH="/usr/local/Cellar/git/2.23.0_1/bin:$PATH"' >> ~/.bash_profile
最新回复(0)