1670s, "of or pertaining to the French," from Latin Gallicus "pertaining to Gaul or the Gauls," from Latin Gallia "Gaul" and Gallus "a Gaul" from a native Celtic name (see Gaelic), though some connect the word with prehistoric West Germanic *walkhoz "foreigners" (see Welsh). Originally used in English rhetorically or mockingly for "French." The cock as a symbol of France is based on the pun of Gallus "a Gaul" and Latin gallus "cock" (see gallinaceous). Earlier was Gallican (1590s).
It means not simply 'French,' but 'characteristically', 'delightfully', 'distressingly', or 'amusingly' 'French' ... not 'of France', but 'of the typical Frenchman'. [Fowler]
As "of or pertaining to the ancient Gauls" from 1796.
"gad about, spend time in frivolous pleasure-seeking, especially with the opposite sex," 1809, of uncertain origin, perhaps a playful elaboration of gallant in an obsolete verbal sense of "play the gallant, flirt, gad about." Related: Gallivanted; gallivanting.
Young Lobski said to his ugly wife,
"I'm off till to-morrow to fish, my life;"
Says Mrs. Lobski, "I'm sure you a'nt",
But you brute you are going to gallivant."
What Mrs. Lobski said was right,
Gay Mr. Lobski was out all night.
He ne'er went to fish, 'tis known very well
But where he went I shall not tell.
["Songs from the Exile," in "Literary Panorama," London, 1809]