我无法卸载Git

时间:2014-12-06 09:16:35

标签: macos git osx-lion uninstall

我尝试在Mac OS X 10.7上更新我的git版本,但它并没有改变版本。 它还在2.0上。

如果我跑,

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

新版本被卸载,但旧版本仍然存在(git仍然是有效命令)。

我怎样才能找到这个" ghost"的目录。版本已安装?

1 个答案:

答案 0 :(得分:13)

要查看git的安装位置:

which git

例如,请参阅这些指南:

位置通常是:

/usr/local/git/bin/git

如“Can't seem to uninstall git”中所述:

/opt/local/bin是macports安装的软件的位置,所以你要运行它:

sudo port uninstall git

如果您看到/ usr / local / bin / git,那可能是brew安装:请参阅“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