gpt4 book ai didi

git - 如何将 Git LFS 与 Azure 存储库和管道一起使用

转载 作者:行者123 更新时间:2023-12-03 14:34:37 26 4
gpt4 key购买 nike

我有一个在 Azure Repos 中使用 Git LFS 的项目,其中使用 Git LFS checkin 了几个二进制图像文件。当我的 Azure Pipelines 构建执行 git pull ,图像文件不是从 Git LFS 中提取的,我留下了几个零字节图像文件。

我正在使用自定义的自托管 Azure Pipelines 构建服务器,该服务器上安装了最新版本的 Git LFS:

PS C:\rehan> git lfs --version                                                                                     git-lfs/2.7.2 (GitHub; windows amd64; go 1.12.2; git 08a08ae0)

我尝试添加步骤来执行 git lfs install但这无济于事。当我手动执行 git lfs pull登录到构建服务器后,文件被正确下载。当我跑 git lfs pull作为 Azure Pipeline 中的构建步骤,我收到以下错误:
fatal: could not read Username for 'https://foo.visualstudio.com': terminal prompts disabled
batch response: Git credentials for https://foo.visualstudio.com/Bar/_git/Bar not found.
error: failed to fetch some objects from 'https://foo.visualstudio.com/Bar/_git/Bar.git/info/lfs'
Downloading LFS objects: 0% (0/1), 0 B | 0 B/s
##[error]PowerShell exited with code '1'.

最佳答案

您必须为 lfs 使用 https 才能与 Azure Devops 一起使用,并且在进行构建时必须进行 LFS check out :

steps:
- checkout: self # self represents the repo where the initial Pipelines YAML file was found
lfs: true

如果您使用的是 UI 向导,则有一个复选框可以检查 lfs

https://docs.microsoft.com/en-us/azure/devops/pipelines/yaml-schema?view=azure-devops&tabs=schema#checkout
https://docs.microsoft.com/en-us/azure/devops/pipelines/repos/pipeline-options-for-git?view=azure-devops#checkout-files-from-lfs

关于git - 如何将 Git LFS 与 Azure 存储库和管道一起使用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56788144/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com