Created
August 23, 2014 19:12
-
-
Save haolly/6163340ab018074f0765 to your computer and use it in GitHub Desktop.
git uninstall.sh in osx git installer
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 | |
pkgutil --packages | grep GitOSX.Installer | xargs -I {} sudo pkgutil --forget {} | |
echo "Uninstalled" | |
else | |
echo "Aborted" | |
exit 1 | |
fi | |
exit 0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment