Skip to content

[Question] How to delete all history of a file but keep the current version commited? #667

@harogaston

Description

@harogaston

Hi! I arrived to this tool with the aim of cleaning my repo's history of some sensitive data.

I started by removing the sensitive data from the tip of all existing branches. We can assume all REFs points to versions of files with no sensitive data. So wanting to re-write and clean up the commit history from sensitive data I did:

$ git filter-repo --sensitive-data-removal --invert-paths --path path/to/file1 --path path/to/file2

I was expecting that after that I would find path/to/file1 and path/to/file2 (and in fact the whole repo) in the same state for every REF (brach specifically) but I found the files are now gone - deleted.

I probably understood this tool wrong. Now, is there a way to achieve what I need? Any help would be much appreciated.
Thank you in advance.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions