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

  • SEARCH
  • Home
  • 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 6069733
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T09:51:14+00:00 2026-05-23T09:51:14+00:00

I tried to remove a file from my remote repo by running: git filter-branch

  • 0

I tried to remove a file from my remote repo by running:

git filter-branch --index-filter 'git rm --cached --ignore-unmatch Rakefile' HEAD

But Git complains that

Cannot create new backup. A previous backup already exists in refs/original/
Force overwriting the backup with -f
rm: cannot remove /.git-rewrite/backup-refs : Permission denied
rm: cannot remove directory /.git-rewrite : Directory not empty

This was after I already deleted the .git-rewrite directory on Windows.

How can I remove that file? It’s a 29Mb file sitting on my repo, so I quite need to remove the file.

I tried to delete the commit in git rebase -i, but apparently because the commit touched a lot of different files, Git complains of conflicts and I aborted to be safe.

  • 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-05-23T09:51:15+00:00Added an answer on May 23, 2026 at 9:51 am

    You have already performed a filter-branch operation. After filter-branch, Git keeps refs to the old commits around, in case something goes wrong.

    You can find those in .git/refs/original/…. Either delete that directory and all files within, or use the -f flag to force Git to delete the old references.

    git filter-branch -f \
    --index-filter 'git rm --cached --ignore-unmatch Rakefile' HEAD
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

When I tried to do a git archive on a file from a remote
i want to download a file from a remote server. i already tried fopen
I tried to remove my Git-files: rm -R .git | yes My CPU becomes
I want to copy a file from a remote server to a local server
Possible Duplicate: git - removing a file from source control (but not from the
I want to remove a temp file from the server after the user close
I have a branch called develop in remote bare repo hub , and I
Excuse the tabs. I'm trying to download a file from remote to local and
I try to remove unnecessary files from git repository. That files were initially added
I accidentally saved a file on the wrong branch. Then I did git reset

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.