The following tutorials work on all MacOS Versions: Mojave, High Sierra, Sierra, El Capitan, Yosemite, Mavericks, Mountain Lion, Lion, Leopard, Snow Leopard.
How to install Git on your MacOS?
Download and install the latest version of Git from here: http://git-scm.com/download/mac
2.20.1 is currently the latest version.
There is another quick way to install git through Homebrew
Enter the following command line:
brew install git
How to upgrade Git on your MacOS?
We can check the current git version by using the following command line through Terminal (Found under /Application/Utilities/)
To upgrade Git from a previous version to the latest, firstly, we need to uninstall the current git, then download and install the latest version
- To uninstall, use the following command line through Terminal since
After upgrading to Mojave, git is not working and users may face the following error:
xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools)
That Xcode Command-line Tools needs to be updated causes the problem.
To fix, Go back to your terminal and hit:
You’ll then receive:
xcode-select: note: install requested for command line developer tools
And be prompted in a window to update Xcode Command Line tools.