Sino-Indian War 1962: http://en.wikipedia.org/wiki/Sino-Indian_War
The USA & UK supported breaking India up into Pakistan, India & East Pakistan (Bangladesh today). Traditional "John Bull" method of divide & conquer (or dominate).
It weakened India and China saw an opportunity to grab land in the north. The US & UK would not support India with armaments so they turned to the only other supplier at the time: the USSR. The Soviets could also influence China.
The effect is still felt today, the majority of Indian armaments are supplied by Russia. There is the fear of China building up a blue water navy... well India has one: they have subs including SSBNs, an aircraft carrier and plans to add more, they also have a naval air arm with Mig 29s... they would prevail in a one-to-one contest with China... and that is the point, deterrence.
They would also turn it on Pakistan in a heartbeat.
China and India "get along" because they have to.
"One resists the invasion of armies; one does not resist the invasion of ideas" Victor Hugo