Origin of "Get Your Goat?"

What is the origin of the phrase “that really gets my goat”, or variations thereof? Did it start with the herdsmen from a lost age? I doubt it…

Thanks,
Jinx

Goats were sometimes placed in the stall of a highstrung, spirited horse. The presence of the goat supposedly calmed the horse. If the goat was removed, the horse’s attitude could change for the worse. There are tales of this occuring prior to important horse races, in order to keep the horse from doing it’s best.

An alternative viewpoint.