The “git” command requires the command line developer tools. Would you like to install? but won't install

I can’t seem to install this. Everytime I start ATOM, this pop up appears. What to do?

This is what happens when i click install.

I have the same issue and can’t get javac to compile in terminal. Have you found any solutions?

Not sure if you found a solution yet but I had the same problem and had to reset my Xcode.

Just access Terminal and use sudo xcode-select --reset.
After that, you should be able to install the tools.