Skip to main content

将仓库中的文件移至 Git Large File Storage

如果您已设置了 Git LFS,而且仓库中已有需要在 Git LFS 中跟踪的文件,您需要首先将该文件从仓库中删除。

After installing Git LFS and configuring Git LFS tracking, you can move files from Git's regular tracking to Git LFS. For more information, see Installing Git Large File Storage and Configuring Git Large File Storage.

If there are referenced Git LFS files that did not upload successfully, you will receive an error message. For more information, see Resolving Git Large File Storage upload failures.

提示

If you get an error that "this exceeds Git LFS's file size limit of 100 MiB" when you try to push files to Git, you can use git lfs migrate instead of filter-repo, to move the large file to Git Large File Storage. For more information about the git lfs migrate command, see the Git LFS 2.2.0 release announcement.

  1. Remove the file from the repository's Git history using the filter-repo command. For detailed information on using these, see Removing sensitive data from a repository.
  2. Configure tracking for your file and push it to Git LFS. For more information on this procedure, see Configuring Git Large File Storage.

Further reading