The gesture originally came from Japan. When making a promise, children link their little fingers and say a certain vow, different in every culture.
But in fact, during the Edo period (1603–1868), bandit clans had a ritual of cutting off their right little fingers to prove their loyalty. It was only much later that kids turned this tradition into a game.