我目前正在克隆 Google Cloud Source 存储库中存在的 git 存储库
gcloud source repos clone sample_repo --project=sample_project
我可以在不使用 gcloud 的情况下克隆 Google Cloud Source Repository 中的 git 存储库吗? 喜欢,
git clone https://source.developers.google.com/p/sample_project/r/sample_repo
最佳答案
gcloud 在克隆时不会做太多事情,它只会设置凭据。事实上,如果你运行
$ gcloud source repos clone default --dry-run
命令(带有 --dry-run
标志)您将看到 git
命令 gcloud
在后台运行:
git clone https://source.developers.google.com/p/YOUR_PROJECT/r/default\
--config credential.helper='!gcloud auth git-helper --account=YOUR_ACCOUNT --ignore-unknown $@'
gcloud credential helper 本质上只是为帐户提供访问 token 。因此,如果您有办法获取凭据,则可以通过这种方式将它们连接到 git 中。
关于git - 在没有 gcloud 的情况下克隆 Google Source Repository,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50129412/