Let $X_1$ and $X_2$ geodesic metric spaces glued along $A$ a proper subspace of both and then given the pseudo metric. Why is the glued space geodesic?
Any hint ? For notation and details one can see Bridson and Hafliger's book, chapter 1 section 5 lemma 5.24.
Let $(X_1,d_1),(X_2,d_2)$ be two geodesic metric spaces and $A$ be a proper metric space with two isometric embeddings $i_1 : A \to X_1$ and $i_2 : A \to X_2$. Finally, let $(X,d)$ denote the gluing $X_1 \coprod_A X_2$. We claim that $X$ is geodesic.
Let $x_1 \in X_1$ and $x_2 \in X_2$. There exists a sequence $(a_n) \subset A$ such that
$$d_1(x_1,i_1(a_n))+d_2(x_2,i_2(a_n)) \underset{n \to + \infty}{\longrightarrow} d(x_1,x_2).$$
Notice that $\{ a_n \mid n \geq 0 \} \subset A$ is bounded, hence compact: Indeed, up to taking a subsquence, we can suppose without loss of generality that
$$d_A(a_n,a_m) = d_1(i_1(a_n),i_1(a_m)) \leq d_1(i_1(a_n),i_1(a_m))+ d_2(i_2(a_n),i_2(a_m)) \leq 2 d(x_1,x_2).$$
Therefore, $(a_n)$ has a subsequence converging to some $a \in A$ such that
$$d(x_1,x_2) = d_1(x_1,i_1(a))+d_2(x_2,i_2(a)).$$
Now, it is now difficult to notice that the concatenation of a geodesic in $X_1$ from $x_1$ to $i_1(a)$ with a geodesic in $X_2$ from $i_2(a)$ to $x_2$ defines a geodesic in $X$ from $x_1$ to $x_2$.