We use a set of observational data for galaxy cold gas mass fraction and gas phase metallicity to constrain the content, inflow and outflow of gas in central galaxies hosted by halos with masses between $10^{11} M_{\odot}$ to $10^{12} M_{\odot}$. The gas contents in high redshift galaxies are obtained by combining the empirical star formation histories of Lu et al. (2014) and star formation models that relate star formation rate with the cold gas mass in galaxies. We find that the total baryon mass in low-mass galaxies is always much less than the universal baryon mass fraction since $z = 2$, regardless of star formation model adopted. The data for the evolution of the gas phase metallicity require net metal outflow at $z\lesssim 2$, and the metal loading factor is constrained to be about $0.01$, or about $60\%$ of the metal yield. Based on the assumption that galactic outflow is more enriched in metal than both the interstellar medium and the material ejected at earlier epochs, we are able to put stringent constraints on the upper limits for both the net accretion rate and the net mass outflow rate. The upper limits strongly suggest that the evolution of the gas phase metallicity and gas mass fraction for low-mass galaxies at $z < 2$ is not compatible with strong outflow. We speculate that the low star formation efficiency of low-mass galaxies is owing to some preventative processes that prevent gas from accreting into galaxies in the first place.