Apple - How to uninstall Git from the command shell?
Do not uninstall Apple-distributed Git. You can leave it as it is and run another version by having it in a directory earlier in PATH
environment variable.
The easiest way to install another version on OS X would be to use Homebrew packet manager.
After installing it, you can run:
brew install git
Homebrew (brew
) will take care of all dependencies and configure the latest Git version, however there is still a chance it will find a setting it cannot resolve automatically, so read what Homebrew says at the end.
Packages installed with brew
do not interfere with system-preinstalled packages.
It installs packages under /usr/local/Cellar
directory and puts executables in /usr/local/bin
, so you just have to keep it in PATH
variable in before /usr/bin
.
For people who installed git by following instructions on official Git homepage, and therefore have git
installed at /usr/local/bin/git
, run the uninstall script:
/usr/local/git/uninstall.sh