This book gives an introduction to fundamental aspects of generalized Riemannian, complex, and Kahler geometry. This leads to an extension of the classical Einstein-Hilbert action, which yields natural extensions of Einstein and Calabi-Yau structures as `canonical metrics in generalized Riemannian and complex geometry. The generalized Ricci flow is introduced as a tool for constructing such metrics, and extensions of the fundamental Hamilton/Perelman regularity theory of Ricci flow are proved. These results are refined in the setting of generalized complex geometry, where the generalized Ricci flow is shown to preserve various integrability conditions, taking the form of pluriclosed flow and generalized Kahler-Ricci flow. This leads to global convergence results, and applications to complex geometry. A purely mathematical introduction to the physical idea of T-duality is given, and a discussion of its relationship to generalized Ricci flow.