我尝试在 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”版本的安装目录?
查看 git 的安装位置:
which git
例如,请参阅这些指南:
- "Mac OS X 上的 Git 和 Github 初学者设置指南 http://burnedpixel.com/blog/setting-up-git-and-github-on-your-mac/"
- "在 Mac OSX 10.10 Yosemite 上安装并更新到最新版本 Git http://coolestguidesontheplanet.com/install-update-latest-version-git-mac-osx-10-9-mavericks/"
位置通常是:
/usr/local/git/bin/git
正如《好像无法卸载git https://superuser.com/a/353301/141":
/opt/local/bin
是 macports 安装的软件的位置,因此您需要运行以下命令:
sudo port uninstall git
如果您看到 /usr/local/bin/git,则可能是brew 安装:请参阅“无法使用自制安装的git https://superuser.com/a/777227/141":
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
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)