Skip to main content

This version of GitHub Enterprise Server was discontinued on 2024-01-04. No patch releases will be made, even for critical security issues. For better performance, improved security, and new features, upgrade to the latest version of GitHub Enterprise Server. For help with the upgrade, contact GitHub Enterprise support.

Moving a file in your repository to Git Large File Storage

If you've set up Git LFS, and you have an existing file in your repository that needs to be tracked in Git LFS, you need to first remove it from your repository.

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."

Tip: 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 or the BFG Repo Cleaner, 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 either the filter-repo command or BFG Repo-Cleaner. 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