-1

Before I am slammed there are several Questions regarding this, however nothing has resolved it. The Remote repo DOES NOT have a file at storage/logs/laravel.log I have wiped the local one with:

>storage/logs/laravel.log

its in .gitignore with:

/storage/logs/

I have also run:

git rm --cached storage/logs/laravel.log
git add -A
git commit -m "update"
git push
git reset --soft HEAD^
git reset HEAD storage/logs/laravel.log
git commit -c ORIG_HEAD
git add -A
git commit -m update
git push

and still get:

remote: error: File storage/logs/laravel.log is 127.11 MB; this exceeds GitHub's file size limit of 100.00 MB

 ! [remote rejected] master -> master (pre-receive hook declined)

What is going on here ? Can somebody give a definitive answer and resolution as to why git is erroring on a file that should not even be part of the repo.

EDIT: This question has been closed down and referred to an answer which either advertises third party software (the question is regarding git only and not java solutions). I have also shown that I have used the examples from that link without success. Further I finally posted a solution that worked for me but the moderator has seen fit to simply remove my solution without justification. I thought a moderator had to give specific reasons for actions. As already stated the 'git only' solutions have not worked up until the one I stumbled across - which is now removed. When did Stackoverflow start REMOVING solutions without explaination ?

SHAME

Datadimension
  • 872
  • 1
  • 12
  • 31
  • EDIT: This question has been closed down and referred to an answer advertising 3rd party software (question is regarding git only and not java). I have shown that I have used the examples from that link without success. Further I finally posted a solution that worked but the you have seen fit to remove my solution without justification. I thought a moderator had to give specific reasons for actions. As already stated the 'git only' solutions have not worked up until the one I stumbled across - which you now removed. When did Stackoverflow start REMOVING solutions without explanation - SHAME – Datadimension Aug 13 '18 at 23:19
  • Obviously torek has trashed this question and not given justification as to why- I actually posted a SOLUTION here - please explain yourself to the community in detail torek ?????????????? – Datadimension Aug 22 '18 at 21:12
  • Appears that torek cannot justify his actions - can I have the solution back for this question so others might benefit from actual information @torek – Datadimension Aug 24 '18 at 21:40
  • There are 14 answers in that other question. I agree that the accepted answer uses a third-party Java method. I have not removed any other answers from there, though, nor any from here (I don't have that power as far as I know); and several of the filter-branch methods should work (as should rebasing). Now that I've been alerted (note that only the `@` comment went to me) I can re-open your question if you like. – torek Aug 24 '18 at 22:34
  • BTW the answer I'd suggest looking at there is Greg Bacon's, https://stackoverflow.com/a/2158271/1256452 – torek Aug 24 '18 at 22:40

1 Answers1

0

One you have committed a large file to your Git repo, it becomes part of the history of that repo. Even if you deleted it, and then commit, it is still in the history, and when you go to push, the hook will still reject you.

This problem has been well covered already on Stack Overflow, but the basic fix is to remove this large file from the history of your branch. Assuming that you were never able to push this branch, due to the large file, there are a number of ways to resolve this. Two good ways are using filter-branch, and doing an interactive rebase. Both of these methods go back and rewrite the history of branch, removing all traces of the large file.

Tim Biegeleisen
  • 502,043
  • 27
  • 286
  • 360
  • Appreciate it is well covered. Please could you specify exactly what will fix this tho - everything I have run seems to not be relevant. – Datadimension Aug 13 '18 at 11:50
  • @Datadimension [See here](https://stackoverflow.com/questions/2100907/how-to-remove-delete-a-large-file-from-commit-history-in-git-repository) for more information. – Tim Biegeleisen Aug 13 '18 at 12:43