2

有没有什么办法可以将git中的文件直接上传到谷歌云存储存储桶?将文件从git传输到Google云存储存储桶

我已经使用下面的命令尝试:

gsutil cp https://Link.git gs://bucketname 

但它给了我一个错误:

InvalidUrlError: Unrecognized scheme "https".

有,我可以将内容上传到这个任何其他方式?

任何帮助非常感谢!

回答

1

引擎盖下偷看显示,在google-cloud-sdk/platform/gsutil/gslib/storage_url.py的(可能)触发错误消息你得:

def _GetSchemeFromUrlString(url_str): 
    """Returns scheme component of a URL string.""" 

    end_scheme_idx = url_str.find('://') 
    if end_scheme_idx == -1: 
    # File is the default scheme. 
    return 'file' 
    else: 
    return url_str[0:end_scheme_idx].lower() 

[...]

def StorageUrlFromString(url_str): 
    """Static factory function for creating a StorageUrl from a string.""" 

    scheme = _GetSchemeFromUrlString(url_str) 

    if scheme not in ('file', 's3', 'gs'): 
    raise InvalidUrlError('Unrecognized scheme "%s"' % scheme) 

基本上该工具不支持通用的URL。

当然 - 可以冒险提高工具,实际上支持从git回购直接复制。但应该指出的是,它只能在菊花链模式下工作。从Options

-D

Copy in "daisy chain" mode, i.e., copying between two buckets by hooking a download to an upload, via the machine where gsutil is run. This stands in contrast to the default, where data are copied between two buckets "in the cloud", i.e., without needing to copy via the machine where gsutil runs.

[...]

Note: Daisy chain mode is automatically used when copying between providers (e.g., to copy data from Google Cloud Storage to another provider).

但由于在这种情况下,数据必须通过运行gsutil本地机器它可能是简单的只克隆本地git仓库,然后使用未修改gsutil从本地回购上传到桶:)

相关问题