克隆谷歌源码库没有gcloud



我目前正在克隆 Google Cloud Source 存储库中存在的 git 存储库

gcloud source repos clone sample_repo --project=sample_project

我可以克隆 Google Cloud Source Repository 中存在的 git 存储库而不使用 gcloud 吗? 喜欢

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 凭据帮助程序基本上只是为帐户提供访问令牌。因此,如果您有办法获取凭据,则可以通过这种方式将它们连接到 git 中。

最新更新