Skip to content

Instantly share code, notes, and snippets.

@klarstil
Created April 5, 2013 06:40
Show Gist options
  • Save klarstil/5317126 to your computer and use it in GitHub Desktop.
Save klarstil/5317126 to your computer and use it in GitHub Desktop.
Uninstall git on Mac OS X
#!/bin/bash
if [ ! -r "/usr/local/git" ]; then
echo "Git doesn't appear to be installed via this installer. Aborting"
exit 1
fi
echo "This will uninstall git by removing /usr/local/git/**/*, /etc/paths.d/git, /etc/manpaths.d/git"
printf "Type 'yes' if you sure you wish to continue: "
read response
if [ "$response" == "yes" ]; then
sudo rm -rf /usr/local/git/
sudo rm /etc/paths.d/git
sudo rm /etc/manpaths.d/git
sudo pkgutil --forget --pkgs=GitOSX\.Installer\.git[A-Za-z0-9]*\.[a-z]*.pkg
echo "Uninstalled"
else
echo "Aborted"
exit 1
fi
exit 0
@HRadmard
Copy link

after running this script, git is still alive in my iMac!

@paul0903
Copy link

Still does not remove anything in 2023

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment