Short answer: She was, in fact, married to all three.
Long answer:
To Vishnu:
Ganga was originally one of Vishnu's three wives. The other two were Lakshmi and Saraswati. Once, the three wives were all together with Vishnu, and Saraswati noticed that Ganga kept ogling their husband playfully and suggestively when she thought the other two were not looking.
This frustrated Saraswati. Angered, she began to accuse Ganga of trying to steal away Vishnu's love. Vishnu, even when asked by Ganga to defend her, remained neutral- for he loved his wives equally. Lakshmi was the one who came to Ganga's defense, and for this, she, too, incurred Saraswati's wrath.
Saraswati cursed Lakshmi first. She cursed her that the other goddess be born on earth as a plant & a river (the plant being tulsi & the river being Gandaki). Ganga, feeling loyalty to her defender, cursed Saraswati to be put on earth as a river. Saraswati retaliated with the same curse. (Thus the rivers Ganga and Saraswati in Northern India)
Vishnu was distressed by seeing his wives fight, so he told Saraswati to go to Brahma and Ganga to Shiva.
From the Devi Bhagavata Purana, see actual passage online
To Shiva
There are not many stories of Ganga's marriage to Shiva, although she is most often pictured, in river form, cascading from Shiva's locks to his temple. Generally, Shiva is the one who is considered Ganga's principal consort. As the biological mother of Kartikeya, she can also be considered Shiva's wife by default.
(See also: What is the symbolism behind Ganga flowing from Lord Shiva's head?)
To Shantanu
Once there was a prince named Mahabhish. He was noble, powerful and honest. He performed a thousand Ashwamedha yagnas and satisfied the gods, the Brahmins, and all the people in his kingdom, even the poor and the sick. For his actions, he was invited to Lord Brahma's palace.
Sages and hermits would often gather and pray here, and one day Ganga too visited. A gust of wind blew, carried away her garment, and exposed Ganga's body. When Brahma saw this, he bowed his heads. When the hermits saw this, they averted their gazes. But Mahabhish did not. He was so smitted by her beauty that he could not take his eyes off of her. Mahabhish, who himself was not wanting in beauty, was handsome enough that Ganga also stared back at him, equally lustful.
Brahma was angered by this. He cursed them to be born on Earth, in the Chandra dynasty. "You are acting like mortals- go and live as them."
Ganga was born as Ganga, Mahabhish (unawaredly) as Shantanu.. It was in their destinies to meet, for Shantanu to fall in love, and for Ganga to drown the 7 Vasus. The 8th Vasu, of course, was Bhishma. (The actual story here is far too long, this is simply an abridged summary)
For more in depth of an explanation
So, long story short: Ganga was married to Vishnu, then sent to Shiva, then cursed to live on earth with Shantanu.