如何从 Mac OS X 10.5.8 卸载 git 版本 1.6.5.1
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/4612326/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
How do I uninstall git version 1.6.5.1 from Mac OS X 10.5.8
提问by Anthony Martin
How do I uninstall git version 1.6.5.1 from Mac OS X 10.5.8?
如何从 Mac OS X 10.5.8 卸载 git 版本 1.6.5.1?
回答by ebaum
回答by Matt
I recently had to upgrade from 1.9.3 to 2.2.1 on Mac OSX 10.10.1
我最近不得不在 Mac OSX 10.10.1 上从 1.9.3 升级到 2.2.1
I successfully ran the installer for 2.2.1, but the command line "git --version" still showed 1.9.3.
我成功运行了 2.2.1 的安装程序,但命令行“git --version”仍然显示 1.9.3。
It turns out that 2.2.1 was successfully installed to /usr/local/git/bin and the directory was added to my path. However, 1.9.3 was installed in /usr/bin, which appeared in my shell PATH variable before /usr/local/git/bin, and so was being called before the updated version.
原来2.2.1已经成功安装到/usr/local/git/bin,目录也加到了我的路径中。但是,1.9.3 安装在 /usr/bin 中,它出现在 /usr/local/git/bin 之前的我的 shell PATH 变量中,因此在更新版本之前被调用。
This was fixed by running "sudo rm -rf /usr/bin/git*" and restarting the command line.
这是通过运行“sudo rm -rf /usr/bin/git*”并重新启动命令行来解决的。
FYI: if you think you're having a similar issue, you can find the various versions of git in your PATH by running "type -a git"
仅供参考:如果您认为自己遇到了类似的问题,可以通过运行“type -a git”在 PATH 中找到各种版本的 git
回答by Jimmy Cuadra
You can do which git
to get the path to the git binary. It should be pretty clear where the git stuff is installed from that. I believe the graphical installer puts it in /usr/local/git
by default. Just remove that directory, and if you want, remove it from your PATH
environment variable as well.
您可以which git
获取 git 二进制文件的路径。从那里安装 git 东西应该很清楚。我相信图形安装程序/usr/local/git
默认将其放入。只需删除该目录,如果需要,也可以将其从PATH
环境变量中删除。
回答by XML
I know this question is specifically about git 1.x, but if you're on git 2.x, there is an uninstall script in your git directory. In my case, it was at:
我知道这个问题专门针对 git 1.x,但是如果您使用的是 git 2.x,那么您的 git 目录中有一个卸载脚本。就我而言,它位于:
/usr/local/git/uninstall.sh
/usr/local/git/uninstall.sh
回答by XML
Just download the new git version you want, and run uninstall.sh (that comes in the git.zip)
只需下载您想要的新 git 版本,然后运行 uninstall.sh(在 git.zip 中)