Git Fails After Upgrading Mac Os

After upgrading Mac OS git would fail with the following error:

$ git pull

Agreeing to the Xcode/iOS license requires admin privileges, please re-run as root via sudo.
$ sudo xcodebuild -license