O'Neil had been with Norwich since 2014 and made 31 Premier League appearances last season as Alex Neil's side were consigned to relegation.
Bristol City Head Coach Lee Johnson told the club's official website, “Gary is a really good signing for us, who adds everything we need to our midfield.
“He's a really good decision maker who can be a coach's eyes and ears on the pitch, whilst also adding value to our younger players by helping us to manage games tactically – both in and out of possession.
“It's important for us to get the balance right between youth and experience, and he's a fantastic character to have around the club. I'm thoroughly looking forward to working with him.”
O'Neil brings a wealth of Championship experience and has won promotion to the Premier League four times during his career. This was with Portsmouth in 2003, West Ham in 2012. QPR in 2014 and Norwich in 2015.