Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

`which git` seems to be lying?

Tags:

linux

macos

Can anyone explain this? which git seems to be lying...

$ which git
/usr/local/bin/git

$ /usr/local/bin/git --version
git version 1.7.9.2

$ git --version
git version 1.7.10.4
like image 673
Nobody Avatar asked Jun 12 '12 03:06

Nobody


1 Answers

Try flushing git from the bash hash table used for path lookups with the command:

hash -d git

Then try again.

Articles for Reference:

  • How Linux or UNIX Understand which program to run – PART I.
  • In bash, “which” gives an incorrect path - Python versions.
like image 121
xelco52 Avatar answered Oct 05 '22 22:10

xelco52