Attempt to simplify and sanitize git handling