RubyMax
RubyMax

Reputation: 341

Updating Git from Version 1.9.0 to 2.2.1

My console recently made me aware that the git version I have installed on my Mac has various security flaws and I was advised to upgrade.

I don't know how to use homebrew so I have gone for an easier option. I was recommended to download the following installed by git-scm.com

http://sourceforge.net/projects/git-osx-installer/?source=typ_redirect

I have installed the package but my terminal still shows:

MacBook-Pro-3:~ mruser$ git --version
git version 1.9.0
MacBook-Pro-3:~ mruser$ which git
/usr/local/bin/git

I have noticed that this version is in the /bin/ folder, which may be the problem? Since the other version installs in the /local/ folder.

How do I remove the old git version 1.9.0 so I can successfully install the new version? (without affecting any of the applications I'm working on)

Thanks for having a look and for any input!

Upvotes: 0

Views: 184

Answers (1)

Schwern
Schwern

Reputation: 164919

The Git in /usr/local (presumably 1.9.0) is shadowing the new release. To determine which program to use, your shell looks through a list of directories stored in your PATH environment variable. You can see it with echo $PATH. Generally /usr/local/bin comes before /usr/bin so you can use newer versions of software without overwriting the system supplied ones.

You need to remove the old version from /usr/local. How you do this depends on where you got Git 1.9.0. If it has an uninstaller, use it. If it doesn't, you can look through /usr/local and delete anything with "git" in it, that will probably be safe.

In the future, use a package manager like Homebrew or Macports. They will track what you have installed and make it much easier to upgrade them.

Upvotes: 2

Related Questions