【问题标题】:Clone Google Source Repository without gcloud在不使用 gcloud 的情况下克隆 Google Source Repository
【发布时间】:2018-05-02 07:41:02
【问题描述】:

我目前正在使用

克隆 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

【问题讨论】:

    标签: git gcloud google-cloud-source-repos


    【解决方案1】:

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

    【讨论】:

    • 这对我来说非常有效,只是做了一点小改动。而不是:--config credential.helper=,y 使用:--config credential.https://source.developers.google.com/.helper=
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2017-08-17
    • 2013-02-25
    • 2021-04-06
    • 1970-01-01
    • 1970-01-01
    • 2020-10-18
    • 2012-07-27
    相关资源
    最近更新 更多