  The distribution of galaxies displays anisotropy on different scales and it
is often referred as galaxy alignment. To understand the origin of galaxy
alignments on small scales, one must investigate how galaxies were accreted in
the early universe and quantify their primordial anisotropic at the time of
accretion. In this paper we use N-body simulations to investigate the accretion
of dark matter subhaloes, focusing on their alignment with the host halo shape
and the orientation of mass distribution on large scale, defined using the
hessian matrix of the density field. The large/small (e1/e3) eigenvalues of the
hessian matrix define the fast/slow collapse direction of dark matter on large
scale. We find that: 1) the halo major axis is well aligned with the e3 (slow
collapse) direction, and it is stronger for massive haloes; 2) subhaloes are
predominately accreted along the major axis of the host halo, and the alignment
increases with the host halo mass. Most importantly, this alignment is
universal; 3) accretion of subhaloes with respect to the e3 direction is not
universal. In massive haloes, subhaloes are accreted along the e3 (even
stronger than the alignment with the halo major axis), but in low-mass haloes
subhaloes are accreted perpendicular to the e3. The transit mass is lower at
high redshift. The last result well explains the puzzled correlation (both in
recent observations and simulations) that massive galaxies/haloes have their
spin perpendicular to the filament, and the spin of low-mass galaxies/haloes is
slightly aligned with the filament, under the assumption that the orbital
angular momentum of subhaloes is converted to halo spin.
