Xcode is actually using the GIT that is stored in /Applications/Xcode.app/Contents/Developer/usr/bin. The same version of GIT gets installed in /usr/bin when you installed the command line tools as part of Xcode installation. So, you won’t be able to change what Xcode is using (unless you are willing to muck with the contents of the Xcode package). If, from a terminal application, you want to use the homebrew-installed GIT then you have two options:
- Reference GIT with the full path as
/usr/local/bin/git ...For this case you can create an alias likealias mgit=/usr/local/bin/gitand then usemgit ...from the terminal - Change the path as
PATH=/usr/local/bin:$PATHeither in your.bashrcor.zshrcif you use zsh file (or each time you start a terminal at the command line).