The origins of Italian nationalism have been traced to the Renaissance. Italian nationalism first arose as a potent political force in the 1830s in the Italian peninsula under the leadership of Giuseppe Mazzini. It served as a cause for Risorgimento in the 1860s to 1870s.
The earliest origins of German nationalism began with the birth of romantic nationalism during the Napoleonic Wars when Pan-Germanism started to rise. Advocacy of a German nation state began to become an important political force in response to the invasion of German territories by France under Napoleon.
hope this helps!