我无法卸载Git [英] I can't uninstall Git

查看:728
本文介绍了我无法卸载Git的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图在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 



请参阅以下指南:


  • 适用于Mac OS X的Git& Github初学者设置指南

    a>

  • 在Mac OSX 10.10 Yosemite上安装并更新到最新版本的Git

  • l>

    位置通常为:

      / usr / local / git / bin / git 






    正如似乎无法卸载git



    / opt / local / bin 是由macports安装的软件的位置,因此您需要运行以下命令:

      sudo port uninstall git 






    如果你会看到/ usr / local / bin / git,这可能是一个brew安装:请参阅不能使用自制软件安装的git

      brew卸载git 
    #确保一切正常,也许brew会给你一些提示
    brew doctor
    brew更新
    brew安装git
    #magic发生,brew会给你提示/ usr / bin发生在/ usr / local / bin
    #之前,并且建议你运行以下命令
    brew doctor
    echo'export PATH =/ usr / local / bin:$ PATH >> 〜/ .bash_profile


    I tried to update my git version on Mac OS X 10.7, but it doesn't change the version. It's still on 2.0.

    If I run,

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

    the new version gets uninstalled, but the old one is still there (git is still a valid command).

    How can I find the directory where this "ghost" version is installed?

    解决方案

    To see where git is installed:

    which git
    

    See for instance those guides:

    The location usually is:

    /usr/local/git/bin/git
    


    As mentioned in "Can't seem to uninstall git":

    /opt/local/bin is the location of software installed by macports, so you'll want to run this:

    sudo port uninstall git
    


    If you see /usr/local/bin/git, that is likely a brew installation: see "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
    

    这篇关于我无法卸载Git的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆