Tianshui revolts
The Tianshui revolts refer to the rebellions that broke out in the southern part of Liang Province (covering parts of present-day Gansu and Shaanxi) in the spring of 228 during the Three Kingdoms period of China. Military forces from the state of Shu Han, led by their chancellor-regent Zhuge Liang, planned to seize control of Chang'an, a strategic city in Shu's rival state, Cao Wei. The three commanderies of Nan'an, Tianshui, and Anding were captured by Shu forces, but these territorial gains were later lost after the Battle of Jieting. As mentioned in the biography of the Wei general Zhang He: "The commanderies of Nan'an, Tianshui and Anding rebelled and defected to (Zhuge) Liang, (Zhang) He pacified all of them." Background
At Hanzhong Commandery, during a war council meeting, Zhuge Liang proposed a wide left flanking manoeuvre to seize the upper Wei River valley to capture the city itself. Wei Yan objected to the plan and proposed a strike through a pass in the Qinling Mountains with 10,000 elite troops to take Chang'an by surprise. Zhuge Liang rejected the plan because it was too ambitious and went for a more cautious approach. The objective was to seize Chang'an along with Tianshui (天水; around present-day Tianshui, Gansu), Anding (安定; around present-day Zhenyuan County, Gansu), and Nan'an (南安; around present-day Longxi County, Gansu) commanderies, and Mount Qi (祁山; the mountainous regions around present-day Li County, Gansu). The revolt
In 228, Zhuge Liang declared that he would march through the Xie Gorge to take Mei County (郿縣; southeast of present-day Fufeng County, Shaanxi). He sent Zhao Yun and Deng Zhi as decoys to give the appearance of threatening Mei County and to occupy Ji County (冀縣; present-day Gangu County, Gansu). Cao Zhen led his armies to oppose them. Zhuge Liang personally led the armies to besiege Mount Qi; the ranks were ordered, discipline severe and authority apparent. The three commanderies of Nan'an, Tianshui, and Anding all revolted and defected from the Wei side to Zhuge Liang, sending shockwaves throughout Liang Province. Cao Rui moved to Chang'an to oversee the defences. Cao Zhen secured Mei County against Zhao Yun, while a combined cavalry-infantry force of 50,000 under Zhang He went west to oppose Zhuge Liang's main army. At that moment, Jiang Wei was patrolling the outskirts with his commanding officer Ma Zun (馬遵), the Administrator of Tianshui Commandery. Afraid that Jiang Wei might be colluding with the Shu army, Ma Zun fled secretly at night to Shanggui County (上邽縣; in present-day Tianshui, Gansu). When Jiang Wei discovered this, it was already too late and on returning to Shanggui County, the defenders refused to open the gates for him. As a result, Jiang Wei defected to the Shu side along with his colleagues Liang Xu (梁緒), Yin Shang (尹賞), and Liang Qian (梁虔). There was in fact no battle at Tianshui; only a revolt took place. The area surrounding the city submitted quickly to Shu, enabling the army to advance steadily but the Shu army had suffered a setback at the Battle of Jieting, when Zhang He defeated Ma Su who was sent by Zhuge Liang to handle him. Zhuge Liang gave the order for a retreat back to Shu territory. Zhao Yun and Deng Zhi were also ordered to counter Cao Zhen, but their troop strengths were inferior to that of the enemy. Hence they were defeated at Ji Gorge (箕谷; east of present-day Baoji, Shaanxi), but their centre held firm and thus avoided a great defeat. Zhao Yun and his army withdrew. The commanderies that rose in revolt to join Shu were later pacified by Zhang He and returned to Wei control. In Romance of the Three Kingdoms
In Chapters 92 and 93 of the 14th-century historical novel Romance of the Three Kingdoms, Jiang Wei was one of the reasons Zhuge Liang went on this expedition, and getting Jiang to defect to Shu became a goal after his quick battle with Zhao Yun. Zhuge Liang sent Zhao Yun ahead first, and after a skirmish and some scheming he comes onto the battlefield. During the battle, Ma Zun (馬遵) suspected Jiang Wei of plotting with the enemy. When Jiang Wei was outside Tianshui, Ma Zun closed the city gates and denied Jiang Wei entry. Jiang Wei had no choice but to defect to Zhuge Liang's side. In popular culture
Starting from the fourth instalment in Koei's video game series Dynasty Warriors, there is a playable stage called "Battle of Tian Shui" that is based on the fictional account of the revolt in Romance of the Three Kingdoms. If the player is playing as Jiang Wei, Wei forces will win the battle, but Jiang himself would later join Shu. If the player is playing on the Shu side, he must defeat Jiang Wei to make him defect to Shu. Notes

References
 Chen, Shou. Records of Three Kingdoms (Sanguozhi) vol. 17, 35, 36, 44. Luo, Guanzhong. Romance of the Three Kingdoms (Sanguo Yanyi) ch. 91-96. Tianshui 228
220s conflicts
228
3rd-century rebellions
Rebellions in China