The 22-year-old, who has signed a one-year deal with the option of a further 12 months, had been expected to leave Bootham Crescent after rejecting a new contract offer, but his move to the Abbey Stadium stalled earlier this month.
"I'm delighted to sign and can't wait to get going," Moke told Cambridge's official website.
"I enjoyed my time at York, but as soon as I found out Cambridge United were interested I wanted to come here and play.
"I want to develop myself as a player and I believe this is the place that I can do that."
Moke made 34 appearances for York last season as they clinched a return to the Football League via the play-offs.