git --version displays wrong version on Terminal

Viewed 681

I am using homebrew to update git. I typed: brew install git

And homebrew tells me git 2.28 is already installed and up-to-date. But, when I type:

git --version

I get:

git version 2.15.0

Why might this be happening and how do I fix it?

I've read that it might have to do with the $PATH, which I do not fully understand. When I type which git

I get: /usr/local/bin/git

1 Answers

Ah. Now I figured out the issue.

I needed to update my shell. Then, when I typed brew install git it said:

Warning: git 2.28.0 is already installed, it's just not linked

So I typed

brew link git

To link the version.

Related