git broken after 10.14.x to 10.15.x macOS upgrade

After upgrading macOS from 10.14.x to 10.15.x git no longer worked:

[email protected]:~ $ git
xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun

Tried this:

[email protected]:~ $ xcode-select --install
xcode-select: note: install requested for command line developer tools

Which raised the following error:

xcode-select error

Tried this, with no success:

[email protected]:~ $ sudo xcode-select --reset

Manually downloaded the latest xcode from the App Store:

xcode download app store

Manually downloading the software is getting us closer:

[email protected]:~ $ git


You have not agreed to the Xcode license agreements. You must agree to both license agreements below in order to use Xcode.

Hit the Return key to view the license agreements at '/Applications/Xcode.app/Contents/Resources/English.lproj/License.rtf'

Agree to the license:

[email protected]:~ $ sudo xcodebuild -license
...
Agree

Success:

[email protected]:~ $ git
usage: git [--version] [--help] [-C <path>] [-c <name>=<value>]
           [--exec-path[=<path>]] [--html-path] [--man-path] [--info-path]
           [-p | --paginate | -P | --no-pager] [--no-replace-objects] [--bare]
           [--git-dir=<path>] [--work-tree=<path>] [--namespace=<name>]
           <command> [<args>]

comments powered by Disqus