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?