0

Because /usr/local/bin is ahead of /usr/bin in my path, I'm picking up the wrong version of git, and XCode is very unhappy.

Instead of manually blowing away /usr/local/git, I'd like to uninstall it properly using whatever package manager originally installed it. I'm pretty sure it wasn't homebrew

  • Why are you sure it wasn't homebrew? You either used homebrew, macports, the download from git-scm.org, or you built it yourself. – Marc Wilson Nov 03 '22 at 00:41

1 Answers1

1

To remove, if you installed via homebrew, run this command:

brew uninstall git

If you installed via macports do this command:

sudo port uninstall git

Otherwise, you installed via downloading a package or compiled yourself. Just manually remove:

sudo rm /usr/local/etc/gitconfig /usr/local/bin/git /usr/local/bin/git-cvsserver \
        /usr/local/bin/git-receive-pack /usr/local/bin/git-shell \
        /usr/local/bin/git-upload-archive /usr/local/bin/git-upload-pack \
        /usr/local/bin/scalar
  • It won't be macports as that leaves /usr/local alone . One reason it does that is exactly this issue. – mmmmmm Nov 03 '22 at 04:11
  • I'm pretty sure I've never used macports on this machine. Homebrew disclaims any knowledge of git. For now, I've done mkdir /usr/local/bin.bak; mv /usr/local/bin/git* /usr/local/bin.bak. If I don't find out what package installed that stuff, I'll go ahead and just delete it. – Edward Falk Nov 03 '22 at 04:48
  • If you installed the macOS download from git-scm.org, it has an uninstaller. What you've been leaving out is what VERSION of git this is, which would help determine where it came from. – Marc Wilson Nov 07 '22 at 15:03