gpt4 book ai didi

git - 复制 git 存储库及其 GIT-LFS 设置

转载 作者:IT王子 更新时间:2023-10-29 00:37:38 25 4
gpt4 key购买 nike

我已经将一个存储库复制到一个较新的存储库中,但是当在新存储库上执行 git clone 时,它​​无法使用 LFS 指针下载文件,并且在使用 smudge 时出现错误...例如...“下载对象时出错。在服务器上找不到对象”

步骤:

git clone --bare https://github.com/myuser/old-repo.git
cd old-repository.git
git push --mirror https://github.com/myuser/new-repo.git

git clone https://github.com/myuser/new-repo.git
[error.....git-lfs.exe smudge --- somefile.....Error downloading object]

分支和提交历史看起来不错,但 LFS 无法下载所需的文件。使用 git-lfs 时还有别的方法吗?

最佳答案

我找到了这个链接:mirroring-a-repository-that-contains-git-large-file-storage-objects

它似乎完全回答了你的问题。您错过的重要部分是 git lfs push/pull:

git clone --bare https://hostname/exampleuser/old-repository.git
cd old-repository.git
git lfs fetch --all
git push --mirror https://hostname/exampleuser/new-repository.git
git lfs push --all https://github.com/exampleuser/new-repository.git

关于git - 复制 git 存储库及其 GIT-LFS 设置,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38315539/

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