Alone - xcode-select --install did not work for me.
Had to do all 3 steps:
Download X-code from app store (if not present in Applications folder)
$xcode-select --install
a. May need to update after install using softwareupdate in command line. $sudo softwareupdate -i "Command Line Tools (macOS High Sierra version 10.13) for Xcode-9.1"
I just recently upgraded to macOS High Sierra Version 10.13.3 and has existing xcode. My git command lines have the same issue. "$xcode-select --install" works perfectly for me.