"German soldier in World War I," 1914, possibly from French slang boche "rascal," applied to the Germans; a word of not known source. Another principle traces it to French Allemand "German," in east French Al(le)moche, altered contemptuously to Alboche by relationship with caboche, a slang word for "head," actually "cabbage" (compare tete de boche, French for "German" in an 1887 slang dictionary). All of the French terms are no older than mid-19c.
unpleasant term for an individual of German lineage
Boche [coll.] [dated] [pej.] [a German, esp. a German soldier in World War I]