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

Joe*_*der 14 git github github-for-windows git-lfs

我已经将repo复制到一个新的repo中,但是当在新的repo上进行git clone时,它无法使用LFS指针下载文件,并且在使用涂抹时出现错误...例如.."下载对象时出错.在服务器上找不到对象"

脚步:

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]
Run Code Online (Sandbox Code Playgroud)

分支和提交历史记录看起来很好,但LFS无法下载所需的文件.使用git-lfs时还有另一种方法吗?

Cha*_*l P 11

我发现了这个链接:mirroring-a-repository-that-c​​ontain-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
Run Code Online (Sandbox Code Playgroud)


jth*_*ill 2

钩子和插件等是 repo-local 配置,如果你的 git-lfs 设置在某种程度上很难第二次提交 repo-setup 脚本来完成它并在第一次结账时运行它。