我正在尝试使用 git-lfs 将大文件从 git 拉到 Docker 容器中。不幸的是,我不断收到错误消息:
...
---> f07e7087dc5a
Step 13/16 : RUN git lfs pull
---> Running in a387e389eebd
batch response: Git credentials for https://github.XXXX.edu/XXXXX/XXXXXXXXX.git not found.
error: failed to fetch some objects from 'https://github.XXXX.edu/XXXXX/XXXXXXXXX.git/info/lfs'
The command '/bin/sh -c git lfs pull' returned a non-zero code: 2
知道如何解决这个问题并让我的文件正确无误地提取吗?我在 Docker 中运行以下命令来尝试让 git-lfs 工作:
# Get git-lfs and pull down the large files
RUN apt-get update && apt-get install -y apt-utils && apt-get install -y curl
RUN curl -s https://packagecloud.io/install/repositories/github/git-lfs/script.deb.sh | bash
RUN apt-get install -y git-lfs
RUN git lfs install
RUN git lfs pull
我也将我的.gitattributes文件和.git文件添加到 Docker 映像中。
编辑:我可以以某种方式使用:
https://you:password@github.com/you/example.git
或者
git config remote.origin.url https://you:password@github.com/you/example.git