"lively, irregular dance," 1560s, of uncertain origin. Perhaps from Middle English gigge "fiddle" (mid-15c.), from Old French gigue "fiddle," also the name of a kind of dance. This is the source of Modern French gigue, Spanish giga, Italian giga, which preserve the "dance" sense, and German Geige, which preserves the "violin" sense. As a verb, "to sing or play a jig," from 1580s.
From 1580s as the music for such a dance. The extended sense "piece of sport, trick" (1590s), survives mainly in the phrase the jig is up (attested by 1777 as the jig is over). As a generic word for handy devices or contrivances from 1875, earlier jigger (1726). Other senses seem to be influenced by jog, and the syllable forms the basis of colloquial words such as jiggalorum "a trifle" (1610s), jigamoree "something unknown" (1844), also jiggobob (1620s), jiggumbob (1610s); and compare jigger (n.). "As with other familiar words of homely aspect, the senses are more or less involved and inconstant" [Century Dictionary].