4

I had a file F that exceeded 100 MB limit that I tried to push. So the push failed. I then removed the file, because it could not be pushed and assumed I needed to do add . ; commit and push again. In the auto generated commit it said deleted file F. Upon push it still tried to upload that file. Well ok, so I figured I need to unstage F. SO I did reset F. I got the message fatal: ambiguous argument 'out': unknown revision or path not in the working tree. No idea what that meant, so I tried to make git show me the staged files diff --cached, but the output is empty. I am confused about the situation and how I can untangle it.

To recap the chain :

$> git add. ; git commit

$> git push

$> remote: error: File F is 143.41 MB; this exceeds GitHub's file size limit of 100.00 MB

$> rm F

$> git add. ; git commit

$> git push

$> remote: error: File F is 143.41 MB; this exceeds GitHub's file size limit of 100.00 MB

$> git diff --cached

$>

lo tolmencre
  • 3,804
  • 3
  • 30
  • 60
  • You have your large file in some older commit. You need to re-write history to get rid of it. You can always inspect your local history using graphical interface provided by `gitk`. `git log --name-only` is your friend as well. Use git commit --amend` or `git reabse -i` to re-write history. – Matt Kucia Oct 15 '16 at 19:59

1 Answers1

9

The problem is that the file is already part of the historical commit.

You need to get back to the commit and amend it:

# reset to previous commit but keeping content:
git reset --soft "HEAD^"
# potentially modify the tree content
# amend the old commit with the file removed:
git commit --amend
# push:
git push
Zbynek Vyskovsky - kvr000
  • 18,186
  • 3
  • 35
  • 43