I will quote, for example, from the Lower Saxony Neighborhood Law:
§ 50 Distance requirements for trees and shrubs
(1) Depending on their height, the following minimum distances from neighboring properties must be observed for trees and shrubs:
a) up to 1.2 m height 0.25 m
b) up to 2 m height 0.50 m
c) up to 3 m height 0.75 m
.....
(2) The distances specified in paragraph 1 also apply to living hedges, if the hedge is not planted on the boundary in accordance with § 30. They also apply to plants that have grown without human intervention.
(3) In the case of § 31, the distance must be measured so that a strip of 0.6 m remains free in front of the plants.
->
§ 30 Joint fencing on the boundary If two neighbors jointly enclose...