Git is a version control system used by developers to manage source code. If you're a MacOS user, you can easily install Git on your system using either Homebrew or the official Git installer. This guide will walk you through both methods.
- If you don't already have Homebrew installed, open Terminal and run the following command:
/bin/bash -c "$(curl -fsSL <https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh>)"
- Once Homebrew is installed, run the following command to install Git:
brew install git
- Wait for the installation to complete. You can verify that Git was installed correctly by running the following command:
git --version
- Go to the Git website and download the latest version of Git for MacOS.
- Double-click the downloaded file to open the Git installer.
- Follow the prompts in the installer to complete the installation.
- Once the installation is complete, open Terminal and run the following command to verify that Git was installed correctly:
git --version
That's it! You now have Git installed on your MacOS system, and you can start using it to manage your source code.