Consider a Riemannian manifold $M$, with a metric $g$. We can find univocally the Levi Civita connection $\nabla$ on $M$, and so a covariant derivative $D_t$ (associated to $\nabla$) along curves. A geodesic is a curve $\gamma$ such that $D_t\gamma'=0$, where $\gamma'$ is the "velocity vector field of $\gamma$ (along $\gamma$)". There is also another approach to geodesic that involves the calculus of variation, so one proves that geodesics are the lenght minimizing curves between two given points.
On a pseudo-Riemannian Manifold $N$ with a pseudo-metric $h$, a geodesic can also be a lenght maximizing curve, so what is the physical importance of these kind of geodesics? For example in special relativity, being a geodesic, mean that the curve is crossed with the largest "proper time" (i.e. the time measured by a clock co-moving...). It means that a particle follows a geodesic if it has the lowest speed; this is a bit strange and seems to be the opposite of the naive concept of "straightest path"!