check if repository directory already exists and remove it if yes