Many proteins are glycosylated on Ser or Thr residues, but the mechanism of O-glycosylation is only poorly understood. A recent study by Chen et al. (Rapoport Lab, in collaboration with Paul Sullam’s lab at San Francisco Veteran Affairs Medical Center) reports on the mechanism by which the cytosolic O-glycosyltransferase GtfA/B of Streptococcus gordonii modifies the Ser/Thr-rich repeats of adhesin, a protein that mediates the attachment of the bacterium to host cells. Crystal structures and biochemical experiments indicate that, during a first phase of glycosylation, the conformation of GtfB is restrained by GtfA to bind substrate with unmodified Ser/Thr residues. In a slow second phase, GtfB recognizes residues that are already modified with N-acetylglucosamine by converting into a relaxed conformation. These results explain how the glycosyltransferase modifies a progressively changing substrate molecule.