I just installed git 1.6.0 from source, but strange thing now happening to me:

debian:~/git# git version
git version
debian:~/git# which git
debian:~/git# /usr/local/bin/git version
git version 1.6.0

How can I make 1.6.0 binary default? System is Debian Lenny. Git installed with simple ./configure && make && make all.

  • Have you considered simply uninstalling version you don't want? – Zoredache Jun 16 '10 at 17:04
  • @Zoredache I want to understand first. – Kuroki Kaze Jun 17 '10 at 8:37

Perhaps your shell is still caching the old mapping. If you use bash, see the builtin 'hash' command, specifically 'hash -r' in order to make it forget old entries, for zsh it's IIRC 'rehash'.

| improve this answer | |
  • Thanks, this seems to be the case (I hadn't the chance to try hash, simple reboot and my git is 1.6.0). – Kuroki Kaze Jun 17 '10 at 8:58

I suggest you uninstall the git package provided by your distribution.

But usually you should prefer the distribution package over installing yourself from source, because it will automatically handle upgrades and removal.

I always make packages when i build from source, i never just "make install". This way i won't end up with manually installed cruft clogging the system.

| improve this answer | |

Edit .bashrc or .profile to specify /usr/local/bin early in PATH.

| improve this answer | |
  • 1
    ...except that /usr/local/bin already was early in the PATH. Apart from being a Debian default, it was also confirmed by the result of "which". – andol Jul 6 '10 at 12:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.