The term Yankee has a variety of meanings. Residents of the United States of America use it to refer to the New York Yankeesbaseball team, a resident of New England, or more often, in the context of the American Civil War, the soldiers and residents of the northern United States including the Midwest, Mid-Atlantic, and New England states, as well as other border-state and African-American troops. Regionally, today Yankee most often refers to a New Englander to denote New England puritan and thrifty values. The principal use of the term in the USA is a means of distinguishing Yankees from those from the South (i.e., the southeastern USA). See also yankee ingenuity
The etymology is uncertain; one suggestion is that it derives from DutchJanke, diminutive of Jan (John), or Jan Kees, for "John Cheese", a nickname for English settlers bestowed by the Dutch in the early days of New York City. The phrase was probably popularized by the English in the song Yankee Doodle Dandee to describe New Yorkers, and perhaps, all (Northern) Americans in the colonies.
Others – that is, speakers from outside of the USA – often use it to refer to any resident of the USA (as opposed to American in general), especially in the form Yank. The words are sometimes spelt with a lowercase initial, yankee and yank, and may be used in a disapproving sense.
In sum, the phrase probably originated in old New Amsterdam, New Holland and New York, in the Mid-Atlantic. It then was adopted by the British to describe (Northern) colonists. In the Civil War, the phrase referred to all residents and soldiers of northern or free states, usually used derisively by rebel troops and secession sympathizers. The Yankees baseball team refocussed attention on New York, and the need to describe the rural, New Englander of puritan stock probably caused reporters and authors to bring back the slang shorthand term of Yankee. Finally, citizens of other countries, including the British during the World Wars, referred to all Americans as Yanks.
In other parts of the world, particularly Latin America, yankee or yanqui is meant as an insult and is politically associated with anti-imperialism and used in expressions such as "Yankee go home".
Hence, the term has had different positive, negative, contextual and regional associations over the years, as books, media, troops, teams, and peoples have used it differently for different purposes.
To foreigners, a Yankee is an American.
To Americans, a Yankee is an Easterner.
To Easterners, a Yankee is a New Englander.
To New Englanders, a Yankee is a Vermonter.
And in Vermont, a Yankee is somebody who eats pie for breakfast.