[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
按照Getting-Started-Installing-Git安装
我的 linux dist 信息。
[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)
这有什么问题?
顺便说一句,我安装了包含 Git 1.7.1
的 Development Tools
。
最佳答案
跟着下面,我解决问题。
yum remove git
exit
# reopen an terminal
现在,一切正常:-)
编辑
其实问题出在hash(man hash
,help hash
),
您可以通过 hash -r
清除所有缓存,或者只清除一个缓存 hash -d git
。
但是,我认为,删除旧版本也不错,保存我的磁盘以防止冲突。
关于linux - Linux 上的 git,正确的路径,错误的版本号,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22967871/