Why Lagrangian has this form in general relativity?

One can derive the geodesic equation by Euler-Lagrangian equation, $$$$\dfrac{\partial \mathcal{L}}{\partial x^\gamma} - \dfrac{d}{ds}\bigg(\dfrac{\partial \mathcal{L}}{\partial (dx^\gamma/ds)}\bigg) =0$$$$ where $$\mathcal{L}= \bigg[ -g_{\mu \nu}\dfrac{dx^\mu}{ds}\dfrac{dx^\nu}{ds}\bigg]^{1/2}.$$ And by searching in some references, i didn't find any clear reason for this form of Lagrangian $$\mathcal{L}$$. Can you give me the reason for this form of Lagrangian?

The integral of the Lagrangian is the proper time elapsed along the particle's worldline $$\gamma$$: $$\tau = \int_\gamma d \tau = \int_\gamma \sqrt{-g_{\mu \nu} dx^\mu dx^\nu} = \int_\gamma \sqrt{-g_{\mu \nu} \frac{dx^\mu}{ds} \frac{dx^\nu}{ds}}ds = \int_\gamma \mathcal{L} \, ds.$$ So any solution to the Euler-Lagrange equations for this "Lagrangian" will extremize the proper time elapsed between the endpoints of $$\gamma$$. But geodesics extremize the proper time between their endpoints, and so a solution to the Euler-Lagrange equations will be a geodesic.