purge-file-from-git

Remove a specified file from entire Git repository history using git-filter-repo.

Updated Dec 3, 2023
One-click install
npx skills add https://github.com/ealvar3z/dotfiles --skill purge-file-from-git
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: purge-file-from-git
Source: https://github.com/ealvar3z/dotfiles/tree/main/prompts/skills/purge-file-from-git
Command: npx skills add https://github.com/ealvar3z/dotfiles --skill purge-file-from-git

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires git-filter-repo, and includes scripts (resource) components.

What problem does it solve?

This Skill permanently removes sensitive files, large binaries, or confidential data from your entire Git repository history, ensuring they are no longer accessible.

Core Features & Use Cases

  • Complete History Removal: Utilizes git-filter-repo to rewrite history and expunge specified files.
  • Safety First: Includes checks and prompts to ensure you understand the destructive nature of the operation.
  • Use Case: You accidentally committed a file containing API keys or a large, unnecessary video file. This skill helps you clean your repository's history before it's widely distributed.

Quick Start

Use the purge-file-from-git skill to remove the file named 'secrets.txt' from the git history.

Frequently Asked Questions about purge-file-from-git

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I remove sensitive data from git history?

To remove sensitive data from git history, this Skill rewrites your entire repository using git-filter-repo. It completely purges specified files containing API keys or confidential information from all past commits, requiring a force-push to update remote branches.

What's the best way to purge a large file from an entire git repository?

The best way to purge a large file from an entire git repository is using git-filter-repo. This Skill rewrites commit history to completely expunge large binary files, permanently reducing repository storage size while requiring a subsequent force-push to synchronize changes.

Does purging files from git history require force-pushing?

Yes, purging files from git history requires force-pushing. Because the process rewrites existing commits to ensure history immutability and permanently remove files, the modified repository history must be forcefully pushed to overwrite the remote branch.

Can I safely delete secrets accidentally committed to git without losing other changes?

You can safely delete secrets accidentally committed to git using git-filter-repo. This Skill includes safety checks and prompts to ensure you understand the destructive operation, rewriting history to remove only specified files while preserving the rest of your commits.

What are the limitations of rewriting git history to remove files?

A key limitation of rewriting git history to remove files is that it alters commit hashes and requires all collaborators to re-clone or force-pull. This Skill permanently changes history to erase sensitive data, meaning previous commit references will no longer be valid.

Do I need to install git-filter-repo to clean my repository history?

Yes, you need to install git-filter-repo to clean your repository history. This Skill depends entirely on git-filter-repo to perform the advanced history rewriting required to completely expunge specified files from your entire Git repository.