I think that it is better to install Git from Homebrew:
Install only what I need - I do not need LLVM compiler, for example.
All packages in one place
No need to re-install command line tools after every macOS upgrade.
Ask Different is a question and answer site for power users of Apple hardware and software. It only takes a minute to sign up.Sign up to join this community
You need the command line tools to install Homebrew anyways, see: https://docs.brew.sh/Installation
- An Intel CPU
- macOS 10.12 or higher
Command Line Tools (CLT) for Xcode: xcode-select --install, developer.apple.com/downloads or Xcode
A Bourne-compatible shell for installation (e.g. bash or zsh)
As @Lizzan pointed out, the Command Line Tools are required in order to
brew install git, but one advantage of the brewed git is that it is often updated more rapidly in response to security patches. For example, 3 days before this writing, homebrew git was updated to 2.19.1 to fix a security vulnerability, while the apple git is still at 2.17.1.