git utils copied from template-anything