Installs the latest version of Git via Homebrew. While macOS ships with a version of Git (via Xcode CLT), it is typically outdated and missing modern features required by DevOps pipelines.
- Detection: Checks if Homebrew's Git is installed via
brew list git. - Privilege Dropping: Identifies the logged-in user and drops privileges from root to the standard user via
sudo -u. - Remediation: Installs the
gitformula securely in the user's Homebrew prefix, overriding the system's default Git.
- Upload script:
install-git.sh - Run script as signed-in user: No (Must start as root to switch context to the local user)