Germany was united in 1871 by common consent and agreement, without force. The movement had its origins in the Hanseatic League, the Holy Roman Empire, the Confederation of the Rhine and the Zollverein (Prussian custom union).
The new Germany was dominated by Prussia for about 50 years, until after the First World War.
Italy was unified over the period 1848-72 by a complex process of agreement and treaties, by wars of independence from France and Austria, by popular uprisings and by military invasion of dissenting states, principalities and cities.
The new Italy was dominated by Lombardy and Piedmont until about 1915, although Rome was declared to be the capital city from the start.