Are you using MacOS? If you've updated Xcode lately, you may need to accept Xcode's terms of service agreement to use git.

$ sudo xcodebuild -license accept