Probing galaxy formation with high energy gamma-rays