问题
From where should I install git:
xcode-select --install
or brew install git
?
回答1:
You need to do xcode-select --install
anyway if you want to do any development.
You can then do
brew install git
and it will install git
into /usr/local/bin/git
without affecting the Apple Xcode git
. There will not be two git versions running, but there will be two installed. Which one runs when you type git
will depend on your PATH. In general, you would want /usr/local/bin
first on your PATH so you benefit from the newer packages provided by homebrew rather than the outdated versions Apple supplies.
回答2:
I'd advise downloading with homebrew. You'll benefit from the frequent updates which will give you access to newer features and more stability.
It's nice that Apple decided to give users an easy way to download programming tools, but they are very out dated.
来源:https://stackoverflow.com/questions/44989618/from-where-should-i-install-git-xcode-select-install-or-brew-install-git