Well, the goat is basically synonymous with Pan = Pagan God of the Hunt; masculine. Pan had small horn, cloven feet, and played a 'pan flute' (hence the name?)
I won't go into the 'witch trials' but basically you can see how the personification of the 'devil' developed with the Christians recognition of the Pagan deity Pan.
Interesting stuff....at least for me
