How can I extend a 1.5" galvanized plumbing vent up a 6:12 pitch roof? Relocate to make clear area for solar
A pair of elbows of any angle can do the trick. For example, a 90 degree elbow can bend the vertical pipe so that it goes horizontally along the top of the wall. A second elbow connected to the first can redirect the pipe so it goes parallel to the rafter at any elevation/angle.

I gave the example with 90 degree elbows but the same principle works with a matched pair of elbows of any angle. The question is whether there's enough room to fit the two-elbow assembly. If it's done with 45 degree angle elbows then the assembly will be narrower, but also taller.

Depending on how important it is that the vent be moved, you could consider other approaches. It would be technically possible to make the vent stack go back down the wall, under the floor, and rise elsewhere as would be done for a sink in an island, or even to combine it with another existing vent. It may also be acceptable to replace the vent stack with an air admittance valve.