Using a micro-focused high-energy X-ray beam, we have performed in situ time-resolved depth profiling during the electrochemical deposition of Sn into an ordered porous anodic alumina template. Combined with micro-diffraction we are able to follow the variation of the structure at the atomic scale as a function of depth and time. We show that Sn initially deposits at the bottom of the pores, and forms metallic nanopillars with a preferred  orientation and a relatively low mosaicity. The lattice strain is found to differ from previous ex situ measurements where the Sn had been removed from the porous support. The dendritic nature of the pore bottom affects the Sn growth mode and results in a variation of Sn grain size, strain and mosaicity. Such atomic scale information of nano-templated materials during electrodeposition may improve the future fabrication of devices.