The function of the mammalian heart depends on the interplay between different cardiac cell types. The deployment of these cells, with precise spatiotemporal regulation, is also important during development to establish the heart structure. In this Review, we discuss the diverse origins of cardiac cell types and the lineage relationships between cells of a given type that contribute to different parts of the heart. The emerging lineage tree shows the progression of cell fate diversification, with patterning cues preceding cell type segregation, as well as points of convergence, with overlapping lineages contributing to a given tissue. Several cell lineage markers have been identified. However, caution is required with genetic-tracing experiments in comparison with clonal analyses. Genetic studies on cell populations provided insights into the mechanisms for lineage decisions. In the past 3 years, results of single-cell transcriptomics are beginning to reveal cell heterogeneity and early developmental trajectories. Equating this information with the in vivo location of cells and their lineage history is a current challenge. Characterization of the progenitor cells that form the heart and of the gene regulatory networks that control their deployment is of major importance for understanding the origin of congenital heart malformations and for producing cardiac tissue for use in regenerative medicine.