An obvious need. I haven’t seen it work in practice yet. “Render Pipeline Coexistence” is on the road map, but who knows how long we will have to wait.
I think the recommended method at the time of writing is to setup two separate projects, one for URP and one for HDRP. Perhaps also divide the projects into multiple git repos, some of which overlap the two projects.