Don't confuse this people with the earlier Di 狄, a nomad people of unknown ethnic stock.
The Di 氐 were a semi-nomad people living in the western regions. They were ethnical relatives to the Qiang 羌 and Tanguts. Di and Qiang are already mentioned in the Confucian Classic Shijing 詩經 "Book of Songs". During the Han period 漢 (206 BCE-220 CE) they lived in the western region of Longxi 隴西, the modern province of Gansu, western Shaanxi and northern Sichuan. The various tribes of the Di were politically not connected and each had their own chieftain. When the Han empire expanded to the west, the Di tribes declared their submission to the Han court and sent their tributes. Their chieftains were appointed official administrators of native commanderies and districts.
At that time the strongest tribe of the Di were the White Horse Di 白馬氐. They lived in the region of Qiuchi 仇池 (modern Chengxian 成縣, Gansu). Emperor Wu 漢武帝 (r. 141-87 BCE) conquered their territory and founded the commandery Wudu 武都. In 108 he resettled the Di in the commandery of Jiuquan 酒泉 farther to the West, where the Di were to control merchant traffic on the Silk Road.
The White Horse Di resisted this enforced migration and in 80 BCE rebelled against the Han empire. At the end of the Later Han period 後漢 (25-220 CE) the most important Di chieftains were Agui 阿貴 who founded the state of Xingguo 興國, and Qianwan 千萬, head of the so-called Hundred-Acres Di 百頃氐. Both tribes were defeated by the warlord Cao Cao 曹操. He also forcibly transferred several thousand Di people to the commanderies Fufeng 扶風 and Tianshui 天水, in order to forestall their alliance with his opponent in the south, Liu Bei 劉備.
Under the Jin dynasty 晉 (265-420), therefore, a lot of Di people lived in the ancient capital region around Chang'an 長安 (modern Xi'an 西安, Shaanxi). As non-Chinese, they were regularly recruited for labour work and so virtually served as labour slaves of the Chinese government. In 296 therefore a lot of Di people rebelled against the Jin government, and their leader Qi Wannian 齊萬年 proclaimed himself emperor. He was defeated three years later.
The Jin government had to flee to the east when numerous non-Chinese tribes rebelled in the early 4th century. Fu Jian 苻健, chieftain of the Linwei Di 臨渭氐 of Lüeyang 略陽, founded the Former Qin empire 前秦 (351-394). His nephew Fu Jian 苻堅 was able to reunite the whole of northern China, but his rule lasted for no more than a decade. A general of his, Lü Guang 呂光, founded the Later Liang empire 後涼 (386-403), and the Di of Qiuchi, called the White Neck Di 白項氐, also founded their own states that lasted until the mid-6th century.
The Di were not purely pastoral nomads but also lived of agriculture and in the course of time learned producing handicraft products. They were famous for several types of fabric, but also for their lacquerwork and their fine honey. Each tribe of the Di had the custom to wear clothes of a different colour, so that there were also the designations Green Di 青氐 or White Di 白氐. The self-designation of the Di was, in Chinese transliteration, Gaizhi 蓋稚. The people of the Di vanished after the reunification of China under the Tang dynasty 唐 (618-907).