macOS install
- Git course
- Beginner
- Lesson 7/80
- 4 min
Learn to install Git on macOS with Homebrew.
Installing Git on macOS
One way to install Git on macOS is by using Homebrew. Homebrew is a package manager for macOS that lets you install software through the terminal. First, Homebrew must be installed on your computer.
brew --versionInstalling Git with Homebrew
Once Homebrew is ready, open the Terminal application and run the Git installation command. The brew install git command downloads and installs the Git package. When the process is complete, you can use Git commands in the terminal.
brew install gitPractice Prepare Homebrew Installation Commands
Assign the Homebrew Git installation command to the installCommand variable. Assign the command used to check the version after installation to the checkCommand variable. Print both commands.
Starter code
// Git kurulum komutunu tanımla
// Sürüm kontrol komutunu tanımla
// İki komutu yazdırSample solution
const installCommand = "brew install git";
const checkCommand = "git --version";
console.log(installCommand);
console.log(checkCommand);Expected output
brew install git git --version
Questions and answers
Review the lesson questions together with their answers. To test yourself, solve the lesson interactively.
1 Which package manager is used to install Git on macOS?
- Device Manager
- Windows Installer
- Homebrew Correct answer
- Git Bash
Explanation: Homebrew is a package manager used to install software from the terminal on macOS.
2 Select the Homebrew Package
const packageName = "____";
console.log(packageName);
const packageName = "git";
console.log(packageName);
Explanation: The package name <code>git</code> is used when installing Git with Homebrew.
3 macOS Installation Tools
| Term | Meaning |
|---|---|
Homebrew |
macOS package manager |
Terminal |
Command execution application |
Xcode Command Line Tools |
Developer tools package |
brew install git |
Git installation command |