社区所有版块导航
Python
python开源   Django   Python   DjangoApp   pycharm  
DATA
docker   Elasticsearch  
aigc
aigc   chatgpt  
WEB开发
linux   MongoDB   Redis   DATABASE   NGINX   其他Web框架   web工具   zookeeper   tornado   NoSql   Bootstrap   js   peewee   Git   bottle   IE   MQ   Jquery  
机器学习
机器学习算法  
Python88.com
反馈   公告   社区推广  
产品
短视频  
印度
印度  
Py学习  »  Git

git--version命令返回的结果与实际安装的结果不同

user3545063 • 6 年前 • 1224 次点击  

尝试用自制更新我的Git,但我遇到了以下问题:

MBP:GitHub_Tutorial nasdas$ brew install git
Warning: git 2.21.0 is already installed and up-to-date
To reinstall 2.21.0, run `brew reinstall git`
MBP:GitHub_Tutorial nasdas$ git --version
git version 2.17.2 (Apple Git-113)
Python社区是高质量的Python/Django开发社区
本文地址:http://www.python88.com/topic/30767
 
1224 次点击  
文章 [ 1 ]  |  最新文章 6 年前
torek
Reply   •   1 楼
torek    6 年前

大概你有 二者都 安装的版本相互独立。

使用 type git which git 看看你在跑哪一个。可能是 /usr/bin/git . BREW安装的可能是 /usr/local/bin/git . 改变你 $PATH (或) $path 或者不管你的壳用什么 /usr/local/bin 之前 /usr/bin 以便 git 将运行新的而不是旧的,或使用 /usr/本地/bin/git 运行新的。

(作为) Greg Bacon notes in a comment ,请注意,您可能需要运行 hash -r 在各种外壳中安装东西后让它们再次检查 /urr/本地/ bin 如果他们已经决定 吉特 方法 /UR/BIN/Git 尽管 $路径 /urr/本地/ bin 早期的。在CSH/TCSH中,这是 rehash 而不是 哈希- R )

(原来是散列问题),你的壳早就决定 吉特 意思是老的那个。再次登录也可以清除这类问题,但这很痛苦!)