我应该从哪里安装 git:xcode-select --install 或 brew install git?

moh*_*haq 3 git macos homebrew

我应该从哪里安装 git: xcode-select --installbrew install git?

Mar*_*ell 7

xcode-select --install如果你想做任何开发,你无论如何都需要做。

然后你可以做

brew install git
Run Code Online (Sandbox Code Playgroud)

它将安装git/usr/local/bin/gitApple Xcode 中而不会影响git。不会有两个 git 版本在运行,但会安装两个。键入时运行哪一个git取决于您的 PATH。通常,您首先需要/usr/local/bin在 PATH 上,这样您才能从homebrew提供的较新软件包中受益,而不是从 Apple 提供的过时版本中受益。