When creating a new environment, use git checkout instead of --branch, since git_ref could be a tag.