Regular pit-patterned Si(001) substrates were prepared by electron-beam lithography followed by plasma chemical etching. The geometry of the pits was controlled by varying the etching conditions and the electron-beam exposure duration. It was shown that the location of three-dimensional (3D) Ge nanoislands subsequently grown on the pit-patterned Si substrates depends on the shape of the pit bottom. In the case of pits having a sharp bottom, 3D Ge islands nucleate inside the pits. For pits with a wide flat bottom, the 3D Ge island nucleation takes place at the pit periphery. This effect is attributed to the strain relaxation depending not only on the initial pit shape, but also on its evolution during the Ge wetting layer deposition. It was shown by Monte Carlo simulations that in the case of a pit with a pointed bottom, the relaxation is most effective inside the pit, while for a pit with a wide bottom, the most relaxed area migrates during Ge deposition from the pit bottom to its edges, where 3D Ge islands nucleate.