c. 1300 (late 13c. as a surname, late 14c. as the name of a dog), "merry, cheerful, naturally of a happy disposition; comical; suggesting joy or merriment," from Old French jolif "festive, merry; amorous; pretty" (12c., Modern French joli "pretty, nice"), a word of uncertain origin. It has an apparent cognate in Italian giulivo "merry, pleasant."
It is often suggested that the word is ultimately Germanic, from a source akin to Old Norse jol "a winter feast" (see yule). OED, however, finds this "extremely doubtful," based on "historic and phonetic difficulties." Perhaps the French word is from Latin gaudere "to rejoice," from PIE *gau- "to rejoice" (see joy).
Meaning "great, remarkable, uncommon" is from 1540s, hence its use as a general intensifier in expressions of admiration. Colloquial meaning "somewhat drunk" is from 1650s. As an adverb from early 15c., "stoutly, boldly." For loss of -f, compare tardy, hasty. Related: Jolliness. Jolly robin "handsome or charming man, gaily dressed man, dandy" is from late 14c.
Broader Middle English senses, mostly now lost, include "vigorous, strong, youthful" (c. 1300); "amorous; lecherous; ready to mate; in heat" (c. 1300); "pleasing, beautiful, handsome; noble-looking; handsomely dressed" (c. 1300); playful, frisky (mid-14c.); "arrogant, overweening, foolish" (mid-14c.).
The Jolly Roger pirate flag is attested by 1724, of unknown origin; jolly here has its otherwise obsolete sense "high-hearted, gallant."