Using the semi-analytic models based on the Millennium simulation, we trace back the evolution of the luminosity function of galaxies residing in progenitors of groups classified by the magnitude gap at redshift zero. We determine the luminosity function of galaxies within 0.25 R 200 , 0.5 R 200 , and R 200 for galaxy groups/clusters. The bright end of the galaxy luminosity function of fossil groups shows a significant evolution with redshift, with changes in M * by ∼1−2 mag between z ∼ 0.5 and z = 0 (for the central 0.5 R 200 ), suggesting that the formation of the most luminous galaxy in a fossil group has had a significant impact on the M * galaxies e.g. it is formed as a result of multiple mergers of M * galaxies within the last 5 Gyr. In contrast, the slope of the faint end, α, of the luminosity function shows no considerable redshift evolution and the number of dwarf galaxies in the fossil groups exhibits no evolution, unlike in non-fossil groups where it grows by ∼25−42% towards low redshifts. In agreement with previous studies, we also show that fossil groups accumulate most of their halo mass earlier than non-fossil groups. Selecting the fossils at a redshift of 1 and tracing them to a redshift 0, we show that 80% of the fossil groups (10 13 M h −1 < M 200 < 10 14 M h −1 ) will lose their large magnitude gap. However, about 40% of fossil clusters (M 200 > 10 14 M h −1 ) will retain their large gaps.