  This paper is a continuation of the previous work of the first author. We
characterize a class of step-two groups introduced in \cite{Li19}, saying
GM-groups, via some basic sub-Riemannian geometric properties, including the
squared Carnot-Carath\'{e}odory distance, the cut locus, the classical cut
locus, the optimal synthesis, etc. Also, the shortest abnormal set can be
exhibited easily in such situation. Some examples of such groups are step-two
groups of corank $2$, of Kolmogorov type, or those associated to quadratic CR
manifolds. As a byproduct, the main goal in \cite{BBG12} is achieved from the
setting of step-two groups of corank $2$ to all possible step-two groups, via a
completely different method. A partial answer to the open questions
\cite[(29)-(30)]{BR19} is provided in this paper as well. Moreover, we provide
a entirely different proof, based yet on \cite{Li19}, for the Gaveau-Brockett
optimal control problem on the free step-two Carnot group with three
generators. As a byproduct, we provide a new and independent proof for the main
results obtained in \cite{MM17}, namely, the exact expression of $d(g)^2$ for
$g$ belonging to the classical cut locus of the identity element $o$, as well
as the determination of all shortest geodesics joining $o$ to such $g$.
