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

标签 linux git centos

[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.1Development 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/

相关文章:

.net - 如何确定文件系统在 .net 中是否区分大小写?

git - 从包文件恢复 git repo

git - 检查详细文件列表以推送 git

windows - 为什么 Linux git 在 Windows WSL 中运行并在 NTFS 文件系统上运行时不创建适当的 Windows 符号链接(symbolic link)?

centos - 鼠标在 Virtual Box 中运行的 CentOS 中停止单击

linux - 如何将此 ssh 命令转换为 ssh_config 文件?

java - 如何使用java和JSch停止linux上的tomcat服务器?

c - 即使所有管道都已关闭,程序仍想获取输入

centos - libtcl8.4.so 和 libtk8.4.so 丢失

linux - 从一个 .sh 脚本运行多个 .sh 脚本?中央操作系统