8

I manually installed git 1.6 a year or two ago. I noticed today that the 1.7 version is available in yum, and installed it (package git-all) I now get the following output:

[root@ovz5197 ~]# git --version
bash: /usr/local/bin/git: No such file or directory
[root@ovz5197 ~]# which git
/usr/bin/git
[root@ovz5197 ~]# /usr/bin/git --version
git version 1.7.4.1
[root@ovz5197 ~]# 

Any idea why the output of which seems to contradict the first line above?

EoghanM
  • 887

1 Answers1

7

If you had already run git from this instance of bash back when there was a /usr/local/bin/git, it's remembering the old location in a cache. Run hash -r to clear the cache. Each instance of bash has its own cache, so newly started instances of bash will look in the right place.

Otherwise, you evidently have a file /usr/local/bin/git, and it's executable, but it doesn't work because its loader is not present on the system. See Getting "Not found" message when running a 32-bit binary on a 64-bit system for a similar case.

  • Yes it must have been a cache - the behaviour is as expected now, thanks very much for explaining! – EoghanM Sep 16 '11 at 11:30