Yes, git from the command line works correctly, and the Tower git client also works fine. (And running sudo xcodebuild -license doesn't work, for what it's worth.)
Ah, I googled an error message from that xcodebuild command, and it told me to run xcode-select --install. I did that, and now RStudio correctly detects git, and the window is back!