This error occurs when you try to use Git on macOS but the Xcode Command Line Tools are not installed. macOS requires these developer tools for Git and other development utilities to function. The fix is simple: install the Command Line Tools using xcode-select --install.
This error message indicates that macOS cannot find the developer tools needed to run Git and other command-line development utilities. On macOS, Git is not installed by default as a standalone application. Instead, it comes bundled with the Xcode Command Line Tools package. When you run any Git command (or other development tools like `make`, `gcc`, or `clang`), macOS checks whether the Command Line Tools are installed. If they're missing, macOS displays this notification prompting you to install them. The path '/Applications/Xcode.app' in the error message refers to the full Xcode IDE installation location, but you don't need the complete Xcode application. The Command Line Tools are a much smaller, standalone package that provides Git, compilers, and other essential development utilities without the full 12+ GB Xcode download.
When you see the system dialog popup, the easiest solution is to click Install in the dialog:
1. A dialog will appear saying "The 'git' command requires the command line developer tools"
2. Click Install to download and install the Command Line Tools
3. Accept the license agreement when prompted
4. Wait for the installation to complete (typically 5-15 minutes depending on your internet speed)
The download is approximately 500MB-1.5GB depending on your macOS version. Once complete, Git will work immediately without any additional configuration.
If the dialog didn't appear or you dismissed it, install directly from the Terminal:
xcode-select --installThis command triggers the same installation dialog. Click Install when it appears.
Alternative: Download from Apple Developer website
If the command doesn't work, you can download manually:
1. Go to https://developer.apple.com/download/more/
2. Sign in with your Apple ID (free account works)
3. Search for "Command Line Tools"
4. Download the version matching your macOS version
5. Open the downloaded .dmg and run the installer
After installation completes, verify Git is working:
# Check Git version
git --version
# Expected output (version may vary):
# git version 2.39.3 (Apple Git-146)
# Verify the Command Line Tools path
xcode-select -p
# Expected output:
# /Library/Developer/CommandLineToolsIf both commands return expected output, Git is properly installed and ready to use.
If you previously had the tools installed but they're not working, reset the installation:
# Remove the current Command Line Tools (requires admin password)
sudo rm -rf /Library/Developer/CommandLineTools
# Reinstall
xcode-select --installAfter a macOS upgrade, this reset is often necessary because the old tools may be incompatible with the new OS version.
# Alternative: Reset the path selection
sudo xcode-select --reset
# Then reinstall
xcode-select --installIf you have the full Xcode application installed, you may need to point to the correct tools location:
# Check current developer directory
xcode-select -p
# If using full Xcode, it shows:
# /Applications/Xcode.app/Contents/Developer
# Switch to standalone Command Line Tools
sudo xcode-select --switch /Library/Developer/CommandLineTools
# Or switch to full Xcode's tools
sudo xcode-select --switch /Applications/Xcode.app/Contents/DeveloperWhen to use each option:
- Use /Library/Developer/CommandLineTools for Git and basic development
- Use /Applications/Xcode.app/Contents/Developer if you need iOS/macOS SDK development
If you prefer not to use Apple's Git or need a newer version, install Git via Homebrew:
# Install Homebrew if not already installed
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
# Install Git via Homebrew
brew install git
# Verify Homebrew Git is being used
which git
# Should show: /opt/homebrew/bin/git (Apple Silicon) or /usr/local/bin/git (Intel)
git --version
# Shows latest Git version, e.g., git version 2.43.0Note: Homebrew still requires the Command Line Tools to be installed for its own compilation needs, but once installed, you'll use Homebrew's Git instead of Apple's.
### Why macOS Requires Xcode Command Line Tools
Unlike Linux distributions where Git is a simple package install, macOS bundles Git as part of its developer toolchain. This design ensures:
- Consistent tooling across all Apple development environments
- Proper integration with macOS security features (code signing, notarization)
- Compatibility with Apple's compiler infrastructure (LLVM/Clang)
### What's Included in Command Line Tools
The Command Line Tools package includes:
| Tool | Purpose |
|------|---------|
| git | Version control |
| make | Build automation |
| clang/gcc | C/C++ compilers |
| lldb | Debugger |
| python3 | Python interpreter |
| swift | Swift compiler |
| Various headers | Development libraries |
### Automatic Updates
Apple periodically updates the Command Line Tools. You may see this error again after a macOS update. To check for updates:
# Check Software Update for Command Line Tools
softwareupdate --list
# Install specific update if available
softwareupdate --install "Command Line Tools for Xcode-XX.X"### Differences: Command Line Tools vs Full Xcode
| Aspect | Command Line Tools | Full Xcode |
|--------|-------------------|------------|
| Size | ~1.5 GB | ~12+ GB |
| Git | Yes | Yes |
| iOS Development | No | Yes |
| Interface Builder | No | Yes |
| Simulator | No | Yes |
| Required for | Git, Homebrew, basic dev | iOS/macOS app development |
For most developers who just need Git, the Command Line Tools are sufficient.
### Corporate/MDM Managed Macs
If your Mac is managed by an organization, software installation may be restricted:
# Check if there are configuration profiles restricting software
sudo profiles show
# The installation might require IT approval
# Contact your IT department if xcode-select --install fails### Troubleshooting "Software Update Not Found" Errors
If you get errors about the software update server:
# Clear the download cache
sudo rm -rf /Library/Developer/CommandLineTools
# Reset software update
sudo softwareupdate --clear-catalog
# Try installation again
xcode-select --installIf still failing, download directly from Apple's developer website.
### Verify Tools Are Properly Linked
Sometimes the tools are installed but not properly linked:
# Check if the tools exist
ls -la /Library/Developer/CommandLineTools/
# Verify usr/bin exists and contains git
ls -la /Library/Developer/CommandLineTools/usr/bin/git
# If missing, reinstall
sudo rm -rf /Library/Developer/CommandLineTools
xcode-select --install### Using Git Before Tools Finish Installing
The Command Line Tools installation can take several minutes. Git won't work until the installation completes. Check progress:
# Check if installation is still running
ps aux | grep "Install Command Line"
# Or check Software Update progress
log show --predicate 'subsystem == "com.apple.SoftwareUpdate"' --last 5mwarning: BOM detected in file, this may cause issues
UTF-8 Byte Order Mark (BOM) detected in file
fatal: Server does not support --shallow-exclude
Server does not support --shallow-exclude
warning: filtering out blobs larger than limit
Git partial clone filtering large blobs warning
fatal: Server does not support --shallow-since
Server does not support --shallow-since in Git
kex_exchange_identification: Connection closed by remote host
Connection closed by remote host when connecting to Git server