Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/git/23.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
linux上的git,路径正确,版本号错误_Linux_Git_Centos - Fatal编程技术网

linux上的git,路径正确,版本号错误

linux上的git,路径正确,版本号错误,linux,git,centos,Linux,Git,Centos,安装跟踪 我的linux区信息 [wen@localhost git-master]$ /usr/local/bin/git --version git version 1.9.0.GIT [wen@localhost git-master]$ which git /usr/local/bin/git [wen@localhost git-master]$ git --version git version 1.7.1 这个怎么了? 顺便说一句,我安装了开发工具,其中包含Git 1.7.1,下

安装跟踪

我的linux区信息

[wen@localhost git-master]$ /usr/local/bin/git --version
git version 1.9.0.GIT
[wen@localhost git-master]$ which git
/usr/local/bin/git
[wen@localhost git-master]$ git --version
git version 1.7.1
这个怎么了?
顺便说一句,我安装了
开发工具
,其中包含
Git 1.7.1

,下面我解决了这个问题

[wen@localhost git-master]$ uname -a
Linux localhost.localdomain 2.6.32-431.11.2.el6.x86_64 #1 SMP Tue Mar 25 19:59:55 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux
[wen@localhost git-master]$ cat /etc/centos-release
CentOS release 6.5 (Final)
现在,一切都好了:-)

编辑

实际上,这个问题是由hash(
manhash
help hash
)引起的, 您可以通过
hash-r
清除所有缓存,或者只清除一个缓存
hash-dgit


但是,我认为,删除旧版本还不错,保存了我的磁盘以防止冲突。

可能是当前shell会话中的哈希路径,但正如您所发现的,删除系统git将防止此类问题的发生。是的,
键入git
输出是
哈希(xxx)
,但我不明白。你的shell会记住它在哪里找到二进制文件,不会再搜索<代码>总是搜索。所以,实际上,问题是散列。只要重新打开终端就能解决这个问题吗?
yum remove git
exit
# reopen an terminal