Registering longitudinal infant brain images is challenging, as the infant brain undergoes rapid changes in size, shape and tissue contrast in the first months and years of life. Diffusion tensor images (DTI) have relatively consistent tissue properties over the course of infancy compared to commonly used T1 or T2-weighted images, presenting great potential for infant brain registration. Moreover, groupwise registration has been widely used in infant neuroimaging studies to reduce bias introduced by predefined atlases that may not be well representative of samples under study. To date, however, no methods have been developed for groupwise registration of tensor-based images. Here, we propose a novel registration approach to groupwise align longitudinal infant DTI images to a sample-specific common space. Longitudinal infant DTI images are first clustered into more homogenous subgroups based on image similarity using Louvain clustering. DTI scans are then aligned within each subgroup using standard tensor-based registration. The resulting images from all subgroups are then further aligned onto a sample-specific common space. Results show that our approach significantly improved registration accuracy both globally and locally compared to standard tensor-based registration and standard fractional anisotropy-based registration. Additionally, clustering based on image similarity yielded significantly higher registration accuracy compared to no clustering, but comparable registration accuracy compared to clustering based on chronological age. By registering images groupwise to reduce registration bias and capitalizing on the consistency of features in tensor maps across early infancy, our groupwise registration framework facilitates more accurate alignment of longitudinal infant brain images.