Abstract We consider a branching model in discrete time for structured population in varying environment. Each individual has a trait, which belongs to some general state space and both the reproduction law and the trait inherited by the offsprings may depend on the trait of the mother and the environment. We study the long time behavior of the population and the ancestral lineage of typical individuals under general assumptions. We focus on the growth rate and the trait distribution among the population for large time and provide some estimations of the local densities. A key role is played by well chosen (possibly non-homogeneous) Markov chains. It relies in particular on an extension of many-to-one formulas [G07, BDMT11] and the analysis...