  We present a new model to describe the galaxy-dark matter connection across
cosmic time, which unlike the popular subhalo abundance matching technique is
self-consistent in that it takes account of the facts that (i) subhalos are
accreted at different times, and (ii) the properties of satellite galaxies may
evolve after accretion. Using observations of galaxy stellar mass functions out
to $z \sim 4$, the conditional stellar mass function at $z\sim 0.1$ obtained
from SDSS galaxy group catalogues, and the two-point correlation function
(2PCF) of galaxies at $z \sim 0.1$ as function of stellar mass, we constrain
the relation between galaxies and dark matter halos over the entire cosmic
history from $z \sim 4$ to the present. This relation is then used to predict
the median assembly histories of different stellar mass components within dark
matter halos (central galaxies, satellite galaxies, and halo stars). We also
make predictions for the 2PCFs of high-$z$ galaxies as function of stellar
mass. Our main findings are the following: (i) Our model reasonably fits all
data within the observational uncertainties, indicating that the $\Lambda$CDM
concordance cosmology is consistent with a wide variety of data regarding the
galaxy population across cosmic time. (ii) ... [abridged]
