无法将 Git LFS 存储库推送到谷歌云服务器

问题描述 投票:0回答:1

我有一个配置为 LFS git 的存储库,具有 .gitattibute。

我已经遵循了这个教程

  1. 我使用
    gcloud source repos create myTestLFS
  2. 创建了一个远程存储库
  3. 已使用
    gcloud source repos clone myTestLFS
  4. 克隆
  5. 更改为 myTestLFS 目录并安装 lfs:
    git lfs install
  6. 创建了一个
    .gitattribute
    文件,其内容为
    *.kra filter=lfs diff=lfs merge=lfs -text
  7. 添加并提交并将
    .gitattibute
    文件推送到远程,它可以工作,但会给出消息
Remote "origin" does not support the Git LFS locking API. Consider disabling it with:
  $ git config lfs.https://source.developers.google.com/p/my-project-id/r/myTestLFS.git/info/lfs.locksverify false
  1. 已创建文件
    acrow.kra
  2. 添加并承诺。但是当我尝试推送时,它给出了以下错误消息:
Uploading LFS objects:   0% (0/101), 0 B | 0 B/s, done.
batch response: Client error &{%!!(string=https) %!!(string=) %!!(*url.Userinfo=<nil>) %!!(string=source.cloud.google.com) %!!(string=/onboarding/welcome) %!!(stri
ng=) %!!(bool=false) %!!(bool=false) %!!(string=) %!!(string=) %!!(string=)}s(MISSING) from HTTP 405
error: failed to push some refs to 'https://source.developers.google.com/p/my-project-id/r/myTestLFS'
git google-cloud-platform git-lfs google-cloud-source-repos
1个回答
0
投票

我尝试了您在我的云 shell 实例中提到的相同步骤。看来您可能错过了正确安装 lfs 或者错过了运行命令

git config lfs.https://source.developers.google.com/p/project_ID/r/myTestLFS.git/info/lfs.locksverify false
您共享的错误消息中建议了这一点。为了供您参考,我分享了我所遵循的详细步骤。我希望这有助于解决您的问题。

  1. 使用

    gcloud source repos create myTestLFS

    创建了远程存储库
  2. 使用命令克隆存储库

    gcloud source repos clone myTestLFS

  3. 切换到

    myTestLFS
    目录并执行
    git lfs install
    ,但出现一些错误。然后我运行命令
    sudo apt-get install git-lfs
    安装 lfs 并成功执行
    git lfs install
    之后没有任何错误。

  4. 使用内容

    .gitattribute file
     创建了 
    \*.kra filter=lfs diff=lfs merge=lfs -text

  5. 已成功提交

    .gitattribute file
    。但是当我尝试推送时,我也遇到了与您类似的错误:

Remote "origin" does not support the LFS locking API. Consider disabling it with:   
$ git config lfs.https://source.developers.google.com/p/project_ID/r/myTestLFS.git/info/lfs.locksverify false
  1. 为了克服上述问题,执行命令

    git config lfs.https://source.developers.google.com/p/project_ID/r/myTestLFS.git/info/lfs.locksverify false

  2. 最后我创建了一个带有一些随机纯文本的新文件(acrow.kra),它已成功推送,没有任何错误。

© www.soinside.com 2019 - 2024. All rights reserved.