👋 We've unified all of GitHub's product documentation in one place! Check out the content for REST API, GraphQL API, and Developers. Learn more on the GitHub blog.


我们经常发布文档更新,此页面的翻译可能仍在进行中。有关最新信息,请访问英文文档。如果此页面上的翻译有问题,请告诉我们
文章版本: Enterprise Server 2.19

迁移到其他 Git Large File Storage 服务器

您可以使用 Git LFS 客户端从现有服务器提取资产并将它们推送到新位置,通过这种方式迁移到新的 Git Large File Storage (Git LFS) 服务器。

Were you able to find what you were looking for?

迁移到其他 Git Large File Storage 服务器之前,您必须将 Git LFS 配置为使用第三方服务器。 更多信息请参阅“将 Git Large File Storage 配置为使用第三方服务器”。

  1. 使用第二个远端配置仓库。

    $ git remote add NEW-REMOTE https://NEW-REMOTE-HOSTNAME/path/to/repo
     
    $ git lfs env
    > git-lfs/1.1.0 (GitHub; darwin amd64; go 1.5.1; git 94d356c)
    > git version 2.7.4 (Apple Git-66)
     
    > Endpoint=https://GITHUB-ENTERPRISE-HOST/path/to/repo/info/lfs (auth=basic)
    > Endpoint (NEW-REMOTE)=https://NEW-REMOTE-HOSTNAME/path/to/repo/info/lfs (auth=none)
  2. 从旧远端提取所有对象。

    $ git lfs fetch origin --all
    > Scanning for all objects ever referenced...
    > ✔ 16 objects found
    > Fetching objects...
    > Git LFS: (16 of 16 files) 48.71 MB / 48.85 MB
  3. 将所有对象推送到新远端。

    $ git lfs push NEW-REMOTE --all
    > Scanning for all objects ever referenced...
    > ✔ 16 objects found
    > Pushing objects...
    > Git LFS: (16 of 16 files) 48.00 MB / 48.85 MB, 879.10 KB skipped

Were you able to find what you were looking for?

问问别人

找不到要找的内容?

联系我们