Here is what I got when I run git
xcrun: error: active developer path ("/Applications/Xcode.app/Contents/Developer") does not exist
Use `sudo xcode-select --switch path/to/Xcode.app` to specify the Xcode that you wish to use for command line developer tools, or use `xcode-select --install` to install the standalone command line developer tools.
See `man Xcode-select` for more details.
As you can see, the command can not locate git correctly.
I just fix it by:
sudo xcode-select --switch /Library/Developer/CommandLineTools/
/Library/Developer/CommandLineTools/ is where my CLT located.
You should: fix your connection problem
install standalone command-line tools
switch its location store by xcode-select