I recently bought a MacBook Pro. I noticed that it comes with git pre-installed. This was not patched version of git. So after following certain tutorials, I used the following steps to update the git to the latest official distribution
- I installed Brew
I ran the following command from brew
brew install git
Though when I ran the command
git --version
from the terminal, I was still pointing towards the previous version.I updated my path variable to point to my new official distribution git.
export PATH=/usr/local/bin:$PATH
After this, I have seen my version is updated to the correct version. I have the following queries:
- Did I lose my offical mac version of git? If not, where is the mac version of git installed?
- I did not set the git environment variable in my bash profile, still when I close the terminal and re-open it, git version is correctly shown.
- How can i update my bash_profile to start reading from my newly installed git version?