The relationship between dark halo mass and stellar mass encodes the entire evolutionary history of galaxies and is a key component in understanding galaxy formation. Since the physical processes driving galaxy formation and regulating star formation are expected to correlate closely to the mass of the dark matter haloes which host them, a profitable avenue to pursue in understanding the evolution of galaxies is to investigate the relationship between the mass in stars and the dark matter halo mass. In my talk I will present new measurements of this relationship in the COSMOS and CFHTLS surveys, which, taken together, comprise the epoch when almost all baryonic mass assembled into stars and galaxies.