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 7400253
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T04:13:17+00:00 2026-05-29T04:13:17+00:00

I accidentally ran commit on a git project with lots of data files in

  • 0

I accidentally ran commit on a git project with lots of data files in it– these are several GB in size.

Then I tried to run push origin master. It compressed everything (over several minutes) and then tried to upload it to the server. I tried several times, but no luck. It is a free git server, and so the push was unsuccessful (probably the project size). The error was:

Compressing objects: 100% (101/101), done. error: RPC failed;
result=55, HTTP code = 0 fatal: The remote end hung up unexpectedly
Writing objects: 100% (101/101), 5.55 GiB | 10.39 MiB/s, done. Total
101 (delta 21), reused 0 (delta 0) fatal: The remote end hung up
unexpectedly fatal: expected ok/error, helper said
‘0009[ffefJMeysq/IJJ,Rj:V޹{L<wܜ[G>@}"<}5{>zQw\~Q’

Now I’ve removed the offending data subdirectory using git rm --cached -r data/ and (just to be safe) moved it to another directory. I reran git commit and then tried to do a git push— but it’s still trying to move all of that data!

I would roll my entire project back to an earlier version, but unfortunately, I’ve been editing other files during this time.

Do you know of a way that I can tell git to please forget the data directory existed? Thank you very much!

  • 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-29T04:13:17+00:00Added an answer on May 29, 2026 at 4:13 am

    In your first commit, you added a commit with data/ to your repository. By doing a git rm -r data/ and then git commit you made a second commit which removes data/. git push has to upload both commits, so it hasn’t helped matters.

    In addition, git rm --cached only removes data from the index. I don’t think your second commit actually removed any files, but you can check that with git log --stat.

    You need to rewrite your history with an interactive rebase. This is not so much rewriting history as rewriting new history. As an insurance policy, start by placing a tag where master is with git tag before_rebase. Then if things go horribly wrong you can always go back to before_rebase and try again.

    You tell git you want to rewrite history going back to origin/master with git rebase -i origin/master. Then you’ll get an editor with something like this:

    pick 064f41f Some change
    pick 1ca69c3 Some other change
    pick 1fa8921 Remove data/
    pick 984alkj Huge amounts of data/
    pick 82adlkj Bug fix
    

    Simply delete the lines representing the offending commits, save and quit the editor. Git will then reapply each remaining change on top of each other. You may get conflicts, resolve them like any other merge.

    Once you’re done, use git log to check that the changes are in fact gone.

    Now you should be able to push and data/ is totally gone from history.

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

Sidebar

Related Questions

I accidentally committed the wrong files to Git , but didn't push the commit
I lost my last commit because I accidentally ran git reset --hard HEAD^. Note:
I accidentally ran git merge some_other_branch on my local master branch. I haven't pushed
Let's say I accidentally wrote this: do { } while (true); ...and then ran
Right, initially ran: c:\regsvr32 Amazing.dll then, (accidentally - I might add) I must have
In a fit of unbelievable stupidity I accidentally ran git checkout -b origin/master And
I accidentally ran svn add * and added a bunch of files that shouldn't
Accidentally I mixed up between 32Bit and 64Bit library files on my x86 embedded
I accidentally committed too many files to an SVN repository and changed some things
I accidentally pushed a commit to GitHub. Is it possible to remove this commit?

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.