We have a remote git repository where there are no size restrictions for files and we had pushed a 300MB into it. We then realized it and then removed the file from the repository.
Meanwhile the same repository was added to github and when we try to push the changes to github, we get the large file size error.
remote: error: File dir/filename is 312.27 MB; this exceeds GitHub's file size limit of 100 MB
To fix this, I tried using the interactive git rebase solution suggested at How to remove/delete a large file from commit history in Git repository?, but at the end of the rebase operation I end up with the following when I do git status
[18:10:35] $ git status
On branch master
Your branch and 'origin/master' have diverged,
and have 8 and 24 different commits each, respectively.
(use "git pull" to merge the remote branch into yours)
And if I use git pull then all the changes which I have removed are brought back to the git repository. How do I fix this?