Phil Haack has a neat script called tree-me[0] that takes a lot of the pain out of this in vanilla Git
[0] https://haacked.com/archive/2025/11/21/tree-me/