1
0
mirror of synced 2025-12-23 11:54:18 -05:00
Files
docs/content/github/managing-large-files/removing-files-from-git-large-file-storage.md
Vanessa Yuen 3df90fc9b8 Hello git history spelunker!
Are you looking for something? Here is all of the GitHub Docs history in one single commit. Enjoy! 🎉
2020-09-27 14:10:11 +02:00

53 lines
3.7 KiB
Markdown

---
title: Removing files from Git Large File Storage
intro: 'If you''ve set up {{ site.data.variables.large_files.product_name_short }} for your repository, you can remove all files or a subset of files from {{ site.data.variables.large_files.product_name_short }}.'
redirect_from:
- /articles/removing-files-from-git-large-file-storage
versions:
free-pro-team: '*'
enterprise-server: '*'
---
### 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](/articles/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 {{ site.data.variables.large_files.product_name_short }} associations.
{% endnote %}
3. Find and remove the associated {{ site.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 {{ site.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](/articles/removing-sensitive-data-from-a-repository)."
2. Optionally, to uninstall {{ site.data.variables.large_files.product_name_short }} in the repository, run:
```shell
$ git lfs uninstall
```
For {{ site.data.variables.large_files.product_name_short }} versions below 1.1.0, run:
```shell
$ git lfs uninit
```
### {{ site.data.variables.large_files.product_name_short }} objects in your repository
After you remove files from {{ site.data.variables.large_files.product_name_short }}, the {{ site.data.variables.large_files.product_name_short }} objects still exist on the remote storage{% if currentVersion == "free-pro-team@latest" %} and will continue to count toward your {{ site.data.variables.large_files.product_name_short }} storage quota{% endif %}.
To remove {{ site.data.variables.large_files.product_name_short }} objects from a repository, {% if currentVersion == "free-pro-team@latest" %}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](/github/administering-a-repository/deleting-a-repository)."{% else %}contact your {{ site.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 {{ site.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 {{ site.data.variables.large_files.product_name_short }}-associated files. For more information, see "[Removing a single file](#removing-a-single-file)" and "[Configuring {{ site.data.variables.large_files.product_name_long }}](/github/managing-large-files/configuring-git-large-file-storage)."
{% endnote %}
### Further reading
- "[About {{ site.data.variables.large_files.product_name_long }}](/articles/about-git-large-file-storage)"
- "[Collaboration with {{ site.data.variables.large_files.product_name_long }}](/articles/collaboration-with-git-large-file-storage/)"
- "[Installing {{ site.data.variables.large_files.product_name_long }}](/articles/installing-git-large-file-storage)"