Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » EGit / JGit » Help - Can't push to GitHub(EGit is trying to push HUGE files to GitHub and I can't remove them.)
Help - Can't push to GitHub [message #1785429] Fri, 13 April 2018 17:11 Go to next message
Diana Eppstein is currently offline Diana EppsteinFriend
Messages: 1
Registered: April 2018
Junior Member
I am getting really frustrated. I have been using git in Eclipse for well over a year but I don't do anything very complicated. Mostly pushing my changes, merging branches that sit on different computers (my PC and Mac) and occasionally pull an occasional file.

Two days ago I accidentally included some sample data in my project. This includes some really HUGE files. I had not intentionally added them to the project. When I tried to push to gitHub, it got all whinny about files that were too big and refused to upload.

I thought no problem I didn't want them in my repository anyway. Well whatever I did.. (moving the files) and trying to remove them from my git repository. It didn't work. I then tried rolling back commit with revert the commit that included these files. This is turn deleted a bunch of files I didn't want deleted... (And I ended on a side project recovering files because wasn't expecting it to revert as far back as it did.

Now git is happy. I have most of my code recovered. But I still can't push to gitHub. I get the impression when I push it wants to ..
a) Push the commit with the huge files.
b) Push the commit with the revert.
c) Push the commit with the new data again.

And since it still can't do A keeps failing in the same place. How can I get it to NOT do a & b? Or delete the big HUGE file(s) from a.

I was told using the command line the revert it should have worked. Should I just try command line routines or will that just make it worse? Is this the difference between a hard and soft revert? I don't understand how to possibly fix this situation and I'm frustrated and wasting a LOT of time spinning and making things worse. I'm considing just finding the "saved.
Re: Help - Can't push to GitHub [message #1785629 is a reply to message #1785429] Tue, 17 April 2018 15:10 Go to previous message
Matthias Sohn is currently offline Matthias SohnFriend
Messages: 1039
Registered: July 2009
Senior Member
Git revert adds another commit on top of your current branch adding the inverse diff like the commit you are reverting.
This has the effect that the huge file you are trying to get rid off is still in the old commit you are reverting and since
this commit is reachable from the revert commit you are trying to push and not yet present on github git will use its
smartness and again try to push all commits reachable from the current branch which aren't available on the server.
And this has the effect that github will again see this huge file and reject the push.

In order to fix that (doesn't matter if you use git command line or EGit) you need to rewrite local history in a way
that the commit containing the offending huge blob is not reachable from the branch you want to push.

If it is in the commit the current branch refers to you can use commit amend to remove the huge file.
Otherwise use interactive rebase, in EGit select the commit preceding the commit containing the huge blob
and click interactive rebase. Then click edit on the commit which contains the bad blob and start the interactive rebase.
It will wind back current branch to this commit and stop rebase so that you can remove huge blob from the commit.
Then commit amend this change and click continue to let rebase interactive put all the other commits on top of
the edited commit. Double check that the commits between current local branch and origin/master do no longer contain
HUGE blob. Then you should be able to push.


c
|
HUGE
|
b <- select this and click interact. rebase
|
a

this yields this list

c
|
HUGE <-click edit on this commit (you want to change its content)

start interactive rebase
edit HUGE to remove the huge file
commit amend
continue rebase



Previous Topic:Is there a `git blame -w` equivalent in "Show Revision Information"?
Next Topic:Does EGit support Large File Storage (LFS)?
Goto Forum:
  


Current Time: Sun Nov 18 08:08:19 GMT 2018

Powered by FUDForum. Page generated in 0.01982 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top