Catalyzes the methylation of glycine by using S- adenosylmethionine (AdoMet) to form N-methylglycine (sarcosine) with the concomitant production of S-adenosylhomocysteine (AdoHcy), a reaction regulated by the binding of 5-methyltetrahydrofolate. Plays an important role in the regulation of methyl group metabolism by regulating the ratio between S-adenosyl-L-methionine and S-adenosyl-L- homocysteine. {ECO:0000269|PubMed:14651980, ECO:0000269|PubMed:14739680, ECO:0000269|PubMed:17660255, ECO:0000269|PubMed:8281755}. This is the function of Ensembl gene identifier ENSG00000124713 (GNMT, glycine N-methyltransferase).