In the framework of the generalized Rastall theory (GRT), we study the ability of a non-minimal coupling between geometry and matter fields in order to provide a setting which allows for a variable G during the cosmic evolution. In this regard, the compatibility of this theory with Dirac hypothesis on the variations of G is investigated, and additionally, the possibility of obtaining the current accelerated universe is also addressed. In summary, our study indicates that, in GRT, having in hand the G profile, one may find the corresponding non-minimal coupling between the energy source and geometry and vise versa, in a compatible way with the current accelerated universe.