Simplify git calls. Remove archive when generation fails.