The 24-year-old had been linked with Blackburn, Fulham, Birmingham, Wolves and West Brom - but has committed his future to the Robins after returning from a holiday in Jamaica.
"I've signed the contract and I'm happy it's all sorted," he told the club's official website. "At the moment I'm concentrating on getting myself as fit as possible so that I'm up and running for July 1."
City boss Gary Johnson added: "There was never a question of him not signing the contract.
"Credit should go to him and to the club. I'm delighted he's signed a new deal with us."