如何从 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

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-10 09:46:08  来源:igfitidea点击:

How do I uninstall git version 1.6.5.1 from Mac OS X 10.5.8

gitmacos

提问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

if which gitreturns /usr/local/git/bin/git as jimmy pointed out,

如果which git像吉米指出的那样返回 /usr/local/git/bin/git ,

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

should do the trick

应该做的伎俩

source here

来源在这里

回答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 gitto 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/gitby default. Just remove that directory, and if you want, remove it from your PATHenvironment 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 中)