Fix bug #3123, "Clean up git". Patch by Christian Hesse.