The structural and optical properties of magnetron sputtered thin films of (ZnO) 1Àx (GaN) x deposited on zinc oxide, sapphire, and silicon oxide are studied as a function of strain accumulation and post-deposition anneals at 600-800 C. For the experimental conditions studied, we found that different amounts of tensile strain accumulated in the samples practically does not affect the strong bandbowing effect, that is, optical bandgap, observed in the as-deposited alloys. In its turn, post-deposition annealing results in a reduction of the tensile strain and dislocation density in the films, as measured by both X-ray diffraction and transmission electron microscopy, corroborating an increase in the crystal quality. In addition, the grain size is found to increase with annealing temperature, for example, mean values of 20 nm up to 50 nm were measured for the alloys with x ¼ 0.15. Meanwhile, the full-width at half maximum of the (0002) X-ray diffraction reflection increases with annealing temperature, but with only a small increase in bandgap energies for the x ¼ 0.15 sample. However, this observation was explained combining the experimental data and first-principles calculations based on density functional theory, showing that the increase in the amount of Ga-N bonds lowers the total energy of the system. As such, we conclude that the thermal treatments increase the Ga-N ordering, resulting in several contributions or a widening of the diffraction peaks.