1
0
mirror of synced 2025-12-21 10:57:10 -05:00
Files
docs/content/github/managing-large-files/versioning-large-files/removing-files-from-git-large-file-storage.md
2021-06-24 11:02:53 -07:00

3.8 KiB

title, intro, redirect_from, versions, shortTitle
title intro redirect_from versions shortTitle
Removing files from Git Large File Storage If you've set up {% data variables.large_files.product_name_short %} for your repository, you can remove all files or a subset of files from {% data variables.large_files.product_name_short %}.
/articles/removing-files-from-git-large-file-storage
/github/managing-large-files/removing-files-from-git-large-file-storage
fpt ghes ghae
* * *
Remove files

Removing a single file

  1. Remove the file from the repository's Git history using either the filter-branch command or BFG Repo-Cleaner. For detailed information on using these, see "Removing sensitive data from a repository."
  2. Navigate to your .gitattributes file.

{% note %}

Note: Your .gitattributes file is generally saved within your local repository. In some cases, you may have created a global .gitattributes file that contains all of your {% data variables.large_files.product_name_short %} associations.

{% endnote %} 3. Find and remove the associated {% data variables.large_files.product_name_short %} tracking rule within the .gitattributes file. 4. Save and exit the .gitattributes file.

Removing all files within a {% data variables.large_files.product_name_short %} repository

  1. Remove the files from the repository's Git history using either the filter-branch command or BFG Repo-Cleaner. For detailed information on using these, see "Removing sensitive data from a repository."
  2. Optionally, to uninstall {% data variables.large_files.product_name_short %} in the repository, run:
$ git lfs uninstall

For {% data variables.large_files.product_name_short %} versions below 1.1.0, run:

$ git lfs uninit

{% data variables.large_files.product_name_short %} objects in your repository

After you remove files from {% data variables.large_files.product_name_short %}, the {% data variables.large_files.product_name_short %} objects still exist on the remote storage{% ifversion fpt %} and will continue to count toward your {% data variables.large_files.product_name_short %} storage quota{% endif %}.

To remove {% data variables.large_files.product_name_short %} objects from a repository, {% ifversion fpt %}delete and recreate the repository. When you delete a repository, any associated issues, stars, and forks are also deleted. For more information, see "Deleting a repository." If you need to purge a removed object and you are unable to delete the repository, please contact support for help.{% else %}contact your {% data variables.product.prodname_enterprise %} administrator to archive the objects. Archived objects are purged after three months.{% endif %}

{% note %}

Note: If you removed a single file and have other {% data variables.large_files.product_name_short %} objects that you'd like to keep in your repository, after deleting and recreating your repository, reconfigure your {% data variables.large_files.product_name_short %}-associated files. For more information, see "Removing a single file" and "Configuring {% data variables.large_files.product_name_long %}."

{% endnote %}

Further reading