make sure git clone and git checkout are only executed once. And fix logs file location