I had updated Xcode last night. I ran git as root via sudo in the terminal and then it said I have not agreed to the Xcode licence terms, and allowed me to view them and then agree in the terminal. I probably would have got the GUI version if I tried to open Xcode.