Germany and the United Kingdom have had diplomatic relations since German unification in 1871.
[1] Prior to that, the only German states holding diplomatic relations with the U.K. were the Kingdom of Prussia, since 1835, and the three Hanseatic cities of Bremen, Hamburg and Lübeck, since 1853.
Source:[2][3] Source:[4] Source:[4] diplomatic relations disrupted due to World War I diplomatic relations disrupted due to World War II