ドキュメントには頻繁に更新が加えられ、その都度公開されています。本ページの翻訳はまだ未完成な部分があることをご了承ください。最新の情報については、英語のドキュメンテーションをご参照ください。本ページの翻訳に問題がある場合はこちらまでご連絡ください。

Removing files from Git Large File Storage

If you've set up Git LFS for your repository, you can remove all files or a subset of files from Git LFS.

ここには以下の内容があります:

Did this doc help you?

Help us make these docs great!

All GitHub docs are open source. See something that's wrong or unclear? Submit a pull request.

Make a contribution

OR, learn how to contribute.

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: 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 Git LFS associations.

  3. Find and remove the associated Git LFS tracking rule within the .gitattributes file.

  4. Save and exit the .gitattributes file.

Removing all files within a Git LFS 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 Git LFS in the repository, run:
    $ git lfs uninstall
    For Git LFS versions below 1.1.0, run:
    $ git lfs uninit

Git LFS objects in your repository

After you remove files from Git LFS, the Git LFS objects still exist on the remote storage.

To remove Git LFS objects from a repository, contact your GitHub Enterprise administrator to archive the objects. Archived objects are purged after three months.

Note: If you removed a single file and have other Git LFS objects that you'd like to keep in your repository, after deleting and recreating your repository, reconfigure your Git LFS-associated files. For more information, see "Removing a single file" and "Configuring Git Large File Storage."

Further reading

Did this doc help you?

Help us make these docs great!

All GitHub docs are open source. See something that's wrong or unclear? Submit a pull request.

Make a contribution

OR, learn how to contribute.