The electrochemical growth of Au nanowires in a template of nanoporous anodic aluminum oxide was investigated in situ by means of grazing-incidence transmission small- and wide-angle x-ray scattering (GTSAXS and GTWAXS), x-ray fluorescence (XRF), and two-dimensional surface optical reflectance. The XRF and the overall intensity of the GTWAXS patterns as a function of time were used to monitor the progress of the electrodeposition. Furthermore, we extracted powder diffraction patterns in the direction of growth and in the direction of confinement to follow the evolution of the direction-dependent strain. Quite rapidly after the beginning of the electrodeposition, the strain became tensile in the vertical direction and compressive in the horizontal direction, which showed that the lattice deformation of the nanostructures can be artificially varied by an appropriate choice of the deposition time. By alternating sequences of electrodeposition with sequences of rest, we observed fluctuations of the lattice parameter in the direction of growth, attributed to stress caused by electromigration. Furthermore, the porous domain size calculated from the GTSAXS patterns was used to monitor how homogeneously the pores were filled.