Skip to content

Documentation suggestion - only make changes after specific commit #702

@cc-stjm

Description

@cc-stjm

I think I've solved my issue here, but thought it might be worth adding to the documentation.

I had a file I wanted to remove from the history, which has been around for a few months, and so now made it into several branches. However, I didn't want to rewrite more than necessary, and some early commits had GPG signatures, which I've worked out you can't handle.

The approach I found, which seems to have worked, is

git filter-repo --refs $(git for-each-ref --contains first-commit-sha-with-problematic-file  --format "%(refname)" ) 

(Together with the arguments to specify the file I wanted removed).

It wasn't clear from the documentation that --refs would accept a list like this.

If there's a better way to do this, I'd also love to know (and also worth adding to the documentation).

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