Mac storage basics · Developer tools
Can I delete old copies of Xcode or install just the command line tools?
Short answer: Yes — extra Xcode copies are ordinary apps you can delete (check xcode-select -p first). If you only need compilers and git, install just the Command Line Tools with xcode-select --install.
Yes. Extra Xcode copies (betas, older versions) are just apps — delete the ones you don't use after checking which one xcode-select -p points to.
If you only need compilers and git for Homebrew or scripting, you don't need Xcode at all: xcode-select --install installs the much smaller Command Line Tools.