Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

I can't uninstall Git

I tried to update my git version on Mac OS X 10.7, but it doesn't change the version. It's still on 2.0.

If I run,

rm -rf /usr/local/git
rm /etc/paths.d/git
rm /etc/manpaths.d/git

the new version gets uninstalled, but the old one is still there (git is still a valid command).

How can I find the directory where this "ghost" version is installed?

like image 635
lazev Avatar asked Dec 06 '14 09:12

lazev


People also ask

How do I completely uninstall Git?

For more information, see Where is Control Panel? in Windows Help. Under "Programs", click Uninstall a program. Right-click the entry named GitHub Desktop, then click Uninstall.

How do I uninstall Git on Windows 11?

Uninstall Git on WindowsOpen Control Panel. Click Uninstall a program that is shown under Programs. We will ban the entry named Git ; right-click that. After that, click Uninstall.


1 Answers

To see where git is installed:

which git

See for instance those guides:

  • "Beginner's Setup Guide for Git & Github on Mac OS X"
  • "Install and Update to latest version Git on Mac OSX 10.10 Yosemite"

The location usually is:

/usr/local/git/bin/git

As mentioned in "Can't seem to uninstall git":

/opt/local/bin is the location of software installed by macports, so you'll want to run this:

sudo port uninstall git

If you see /usr/local/bin/git, that is likely a brew installation: see "Can't use homebrew installed git":

brew uninstall git
# make sure everything is alright, maybe brew will give you some hint
brew doctor
brew update  
brew install git
# magic happen, brew will give you hint /usr/bin occurs before /usr/local/bin
# and recommend you run following command
brew doctor
echo 'export PATH="/usr/local/bin:$PATH"' >> ~/.bash_profile
like image 148
VonC Avatar answered Oct 05 '22 08:10

VonC