■ Install Git on Mac
To install Git on macOS, there are the following 4 options;
The following options are mentioned in the article of
and
Install Git | Atlassian Git Tutorial.
Option 1. Auto install
This option is the easiest way to install Git.
- Open a Terminal on your Mac. Now, type the following command into your Terminal.
git --version
If you don’t have git installed already, it will prompt you to install it.
You can install only git by clicking “Install” button.
Or, you can install Xcode with Git component by clicking “Get Xcode”.
Option 2. Git for Mac Installer
- Download Git from “Git download” page (mentioned above URL).
- Once your download is finished, open the file and go through the installation process.
- Done!
Option 3. Install Git with Homebrew
If you have [installed Homebrew to manage packages on OS X, you can follow these instructions to install Git.
- Open your terminal and install Git using Homebrew.
brew install git
- Verify the installation was successful by typing which
git --version
.
git --version
Option 4. Install Git with MacPorts
If you have installed MacPorts to manage packages on OS X, you can follow these instructions to install Git.
- Open your terminal and update MacPorts.
sudo port selfupdate
- Search for the latest available Git ports and variants.
port search git
port variants git
- Configure your Git username and email using the following commands, replacing Emma’s name with your own. These details will be associated with any commits that you create:
sudo port install git +bash_completion+credential_osxkeychain+doc