xcodebuild firing after every terminal command
The problem is that the Xcode license hasn't been accepted so when running git it tries to prompt you for accepting the license. For me running

sudo xcodebuild -license accept


fixed the issue