Let $M$ be a Riemannian manifold, and $p,q\in M$ two points. Now, if $M$ is a complete metric space the Hopf–Rinow theorem ensures that there is a geodesic $C\subset M$ joining $p$ and $q$ that minimizes distance.
On the other hand, we always have the notion of geodesic as curve that locally in a neighborhood of a given point minimizes distance.
My question is the following: can the global geodesic $C$ be constructed by "smoothly prolonging" local geodesics? Here with "smoothly prolonging" I mean that we can find local geodesics $C_1,\dots, C_r\subset M$ with $p\in C_1, q\in C_r$ such that their union $C_1\cup C_2\cup\dots\cup C_r = C$ is smooth.