Both!
I remember reading a climbing guide a while ago and it recommended getting into an easier gear and build reserves while maintaining speed, at the start of the hill, work into your current gear, shift as necessary but stay in a gear where standing is possible, only after exhausting standing do I sit back down and shift to the last one or two easier gears left.
I tend to find a lot of power by "pulling up" quite a bit in the few pedal strokes prior to standing up.