Starting from the formulation of gauge theories on a lattice we derive renormalization group transformation of the Migdal-Kadanoff type in the presence of fermions. We consider the effect of the fermion vacuum polarization on the gauge Lagrangian but we neglect fermion mass renormalization. We work out the weak coupling and strong coupling expansion in the same framework. Asymptotic freedom is recovered for the non-Abelian case provided the number of fermion multiplets is lower than a critical number. Fixed points are determined both for the U(1) and SU(2) case. We determine the renormalized trajectories and the phases of the theory.