1683, a name applied disparagingly by Dutch settlers in New Amsterdam (New York) to English colonists in neighboring Connecticut. It may be from Dutch Janke, literally "Little John," diminutive of common personal name Jan; or it may be from Jan Kes familiar form of "John Cornelius," or perhaps an alteration of Jan Kees, dialectal variant of Jan Kaas, literally "John Cheese," the generic nickname the Flemings used for Dutchmen.

[I]t is to be noted that it is common to name a droll fellow, regarded as typical of his country, after some favorite article of food, as E[nglish] Jack-pudding, G[erman] Hanswurst ("Jack Sausage"), F[rench] Jean Farine ("Jack Flour"). [Century Dictionary, 1902, entry for "macaroni"]

It originally seems to have been applied insultingly to the Dutch, especially freebooters, before they turned around and slapped it on the English. A less-likely theory is that it represents some southern New England Algonquian language mangling of English. In English a term of contempt (1750s) before its use as a general term for "native of New England" (1765); during the American Revolution it became a disparaging British word for all American native or inhabitants. Shortened form Yank in reference to "an American" first recorded 1778.

Yankee definition

Originally a nickname for people from New England, now applied to anyone from the United States. Even before the American Revolutionary War, the term Yankee was used by the British to refer, derisively, to the American colonists. Since the Civil War, American southerners have called all northerners Yankees. Since World War I, the rest of the world has used the term to refer to all Americans.

Note: The expression “Yankee, go home” reflects foreign resentment of American presence or involvement in other nations' affairs.