Using a representative sample of 65 intermediate mass galaxies at z \sim 0.6 , we have investigated the interplay between the main ingredients of chemical evolution : metal abundance , gas mass , stellar mass and SFR . All quantities have been estimated using deep spectroscopy and photometry from UV to IR and assuming an inversion of the Schmitt-Kennicutt law for the gas fraction . Six billion years ago , galaxies had a mean gas fraction of 32 \% \pm 3 , i.e . twice that of their local counterparts . Using higher redshift samples from the literature , we explore the gas-phases and estimate the evolution of the mean gas fraction of distant galaxies over the last 11 Gy . The gas fraction increases linearly at the rate of 4 % per Gyr from z \sim 0 to z \sim 2.2 . We also demonstrate for a statistically representative sample that < 4 % of the z \sim 0.6 galaxies are undergoing outflow events , in sharp contrast with z \sim 2.2 galaxies . The observed co-evolution of metals and gas over the past 6 Gyr favours a scenario in which the population of intermediate mass galaxies evolved as closed-systems , converting their own gas reservoirs into stars .