Muh*_*eed 15 git git-lfs azure-pipelines azure-repos
我有一个在 Azure Repos 中使用 Git LFS 的项目,其中使用 Git LFS 签入了几个二进制图像文件。当我的 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)
Run Code Online (Sandbox Code Playgroud)
我试过添加步骤来执行,git lfs install但这没有帮助。当我git lfs pull登录到构建服务器后手动执行 a 时,文件被正确下载。当我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'.
Run Code Online (Sandbox Code Playgroud)
4c7*_*b41 28
您必须为 lfs 使用 https 才能与 Azure Devops 一起使用,并且在进行构建时必须进行 LFS 检出:
steps:
- checkout: self # self represents the repo where the initial Pipelines YAML file was found
lfs: true
Run Code Online (Sandbox Code Playgroud)
如果您使用的是 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
| 归档时间: |
|
| 查看次数: |
6205 次 |
| 最近记录: |