It is difficult to establish the properties of massive stars that explode as supernovae1,2. The electromagnetic emission during the first minutes to hours after the emergence of the shock from the stellar surface conveys important information about the final evolution and structure of the exploding star3,4,5,6. However, the unpredictable nature of supernova events hinders the detection of this brief initial phase7,8,9. Here we report the serendipitous discovery of a newly born, normal type IIb supernova (SN 2016gkg)10, which reveals a rapid brightening at optical wavelengths of about 40 magnitudes per day. The very frequent sampling of the observations allowed us to study in detail the outermost structure of the progenitor of the supernova and the physics of the emergence of the shock. We develop hydrodynamical models of the explosion that naturally account for the complete evolution of the supernova over distinct phases regulated by different physical processes. This result suggests that it is appropriate to decouple the treatment of the shock propagation from the unknown mechanism that triggers the explosion.