Everything within the usual boundary distance, usually 3.0m, is considered boundary construction. Whether the garage is directly on the boundary or has a 2m distance does not matter; both are considered boundary construction and fall under the 15m rule. However, there are now efforts to reduce the required distances in building zones to 2.5m or even 2m boundary distance. With individual approval/neighbor consent or similar, smaller distances can also be permitted.
In principle, a carport can also be built with a distance if you want to reach it for painting - but this is usually not necessary because you are allowed to enter the neighbor’s property for maintenance/repair if there is no other option. This must be reported, but it should work under normal neighborly relations.
Best regards
Dirk Grafe