Install Xcode Command Line Tools on Mac
Get git, clang and other dev tools without installing full Xcode.
Run the command below, then click Install in the dialog that appears. Download takes a few minutes; git and clang are ready afterwards.
01Command
Command
$ xcode-select --install02What it does
Many developer tools (git, make, clang, Homebrew prerequisites) need Apple's compiler toolchain. This installs just the Command Line Tools (~1–2 GB) instead of the full Xcode IDE, and registers it as the active developer directory via xcode-select.
03Risk
04Undo
✓No undo needed — this command does not change persistent state.
05Sources
- TN2339: Building from the Command Line with XcodeEvidence: xcode-select --install opens a dialog to install the Command Line Tools package.
Last verified: 2025-11-14 · Category: Developer
06Related solutions
Flush the DNS cache on Mac
Clear cached DNS lookups when a site resolves to a stale IP address.
Prevent your Mac from sleeping for one hour
Temporarily stop macOS from sleeping without changing Energy settings.
Zip a folder on Mac from Terminal
Create a clean zip archive of any folder, preserving macOS metadata.