Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8010141
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T18:39:12+00:00 2026-06-04T18:39:12+00:00

A large binary file was added to my git repository 20 commits ago. Removing

  • 0

A large binary file was added to my git repository 20 commits ago. Removing this with:

git filter-branch --index-filter "git rm --cached --ignore-unmatch FILE" \
    --prune-empty HEAD

changes the SHA1 for every commit (~1100) in my projects history. It does remove the file, but I was hoping to only have git push -f a small number of modified commits. Is there a way to tell filter-branch to only modify commits with FILE and descendant comments, in my case around 20 commits?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T18:39:14+00:00Added an answer on June 4, 2026 at 6:39 pm

    If you know what commit introduced the file, the simplest way is to specify $SHA^..HEAD (where $SHA is the commit that introduced it). This will prevent it from even looking at older commits.

    If the commit that introduced this file only introduced it, and nothing more, and no other commits since then touched it, then you can get rid of it even simpler without a filter-branch, by using git rebase --onto $SHA^ $SHA (where $SHA is the commit that introduced this file). That will simply drop the commit $SHA from history.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Unfortunately we accidently checked in a large binary file some time ago and until
I have moderately large binary file consisting of independent blocks like this: header1 data1
If I have a large binary file (say it has 100,000,000 floats), is there
I have a very large binary file and I need to create separate files
I have a large binary file to parse, and i am not sure about
Using a very large raw binary data file, I will be creating a large
I have a program that opens a large binary file, appends a small amount
I'm commiting a large changeset, including a large binary file (180 MB) over a
Given a really large, 3+ gig, binary file is there anyway that I could
I have a large (3Gb) binary file of doubles which I access (more or

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.