How can one construct the colimit of a general diagram of groups?
On the first page of Serre's Trees (English translation) it says [$G_i$'s are arbitrarily indexed input groups and $F_{ij}$'s sets of maps $G_i\to G_j$]:
Existence is easy. One can, for example, define $G$ by generators and relations; one takes the generating family to be the disjoint union of those for the $G_i$; as relations, on the one hand the $xyz^{-1}$ where $x,y,z$ belong to the same $G_i$ and $z=xy$ in $G_i$, on the other hand the $xy^{-1}$ where $x\in G_i$, $y\in G_j$ and $y=f(x)$ for at least one $f\in F_{ij}$.
My understanding of this is we start with the free group on a disjoint union of generating sets for the inputs. But then, it seems like we can only quotient the relations described, for values $x, y, z$ in the generating sets. What if my generating set for $G_i$ contains distinct $x, y, z, t$ such that $xyz = t$ in $G_i$? Then we should have $xyz = t$ in $G$, but I don't see why we do.