For future reference, this issue is not that difficult to understand or solve. It is because when you commit a large file without pushing and then you untrack that large file, commit again and try to push, git still has the old ancestor commit in its history telling it to commit the large file before you untracked it. It is doing exactly what you are telling it to do: untracking the file at the point you specified--which unfortunately is after a commit that needs to be pushed. So it wants to push the file, then untrack it. Sometimes, you may inadvertently commit a large file and then put multiple commits over it without trying to push, which means that you will have multiple commits that need to be re-written before the repo will accept a push. What you need to do is get rid of any ancestor commits containing the large file. This can be accomplished many ways, such as rebasing and squashing the commits (use 'git rebase -i origin/master [or whatever branch]), doing a tricky and sometimes dangerous 'git filter-branch', or my favorite, simply soft resetting the branch you are on to the period before you added the file and recommitting all your changes since then with the problem file now gone. From the sound of it the OP may have tried something like this, but probably didn't reset far enough back. What you need to do is remove the file from your working directory (when the problem is solved you can put it in your .gitignore and move it back), then do the following: Find out how far ahead you are of the remote: 'git status' It will tell you how many commits you are ahead. If it is 3 commits, do this: 'git reset --soft HEAD~3' (Replace 3 with however many commits you are ahead.) (Be careful not to mess up this command and do a hard reset, or you will lose your work. It needs to be a soft reset, which resets your git status but leaves your disk untouched..) Then re-add everything: git add -A And recommit: git commit -m "Squashed commit" Push. 'git push' It should be as though the file was never committed.
... View more