How do you beat the prologue boss in NieR:Automata?

Quick answer: The boss is the Goliath Engels. On the ground, dodge its saw swipes, claps and arm smashes and hit the exposed saws. In the air phase, dodge its rockets, beam and sweeps, then turn its own arm against it.
Show walkthrough (quest spoilers)
Ground phase
Engels attacks with two huge buzzsaw arms: double swipes, alternating saws, a clap and arm smashes. Stand in the middle for the double swipe and dodge the clap and smashes at the last moment. Its diagonal strike leaves a blade exposed, so attack it then and keep your Pod shooting.
When it goes under
Engels dives under the water and charges at you. Run toward the camera to get out of its way. Later 9S hacks it, and you climb up the Goliath, killing the machines on the way.
Air phase
2B and 9S fight on in Flight Units, at long range. Dodge the homing rockets left or right, fly high over its web attack and fly low under its horizontal sweep. Watch for the beam from its face and its vertical slash.
Finish it
Near the end you take control of its arm. Turn the arm against Engels while you stay on higher ground until its health runs out. See the Prologue walkthrough for what comes after.
