Halo assembly bias is the secondary dependence of the clustering of dark-matter haloes on their assembly histories at fixed halo mass. This established dependence is expected to manifest itself on the clustering of the galaxy population, a potential effect commonly known as galaxy assembly bias. Using the IllustrisTNG300 magnetohydrodynamical simulation, we analyse the dependence of the properties and clustering of galaxies on the shape of the specific mass accretion history of their hosting haloes (sMAH). We first show that several halo and galaxy properties strongly correlate with the slope of the sMAH (𝛽) at fixed halo mass. Namely, haloes with increasingly steeper 𝛽 increment their halo masses faster at early times, and their hosted galaxies present larger stellar-to-halo mass ratios, lose their gas faster, reach the peak of their star formation histories at higher redshift, and become quenched earlier. We also demonstrate that 𝛽 is more directly connected to these key galaxy formation properties than other broadly employed halo proxies, such as formation time. Finally, we measure the secondary dependence of galaxy clustering on 𝛽 at fixed halo mass as a function of redshift. By tracing back the evolution of individual haloes, we show that the amplitude of the galaxy assembly bias signal for the progenitors of 𝑧 = 0 galaxies increases with redshift, reaching a factor of 2 at 𝑧 = 1 for haloes of 𝑀 halo = 10 11.5 − 10 12 ℎ −1 M . The measurement of the evolution of assembly bias along the merger tree provides a new theoretical perspective to the study of secondary bias. Our findings, which show a tight relationship between halo accretion and both the clustering and some of the main observational properties of the galaxy population, have also important implications for the generation of mock catalogues for upcoming cosmological surveys.