Shookie Shookie - 11 months ago 45
Git Question

Trying to migrate to Github from Bitbucket, getting file size error

I'm trying to migrate from bitbucket to github. What I did was remove bitbucket from the remote and add my github account instead. I then tried to

git push -u origin master
but I got a
large file detected
error and then a
this exceeds Github's file size limit of 100MB

I know which file is making the problem and I've deleted it a few commits ago but since it's still in previous commits it's still making problems.

How can I fix this?

Answer Source

GitHub places a hard limit on the size of individual files:

GitHub warns you when you try to add a file larger than 50 MB. We'll reject pushes containing files larger than 100 MB.

If any commit in your repo contains that file, GitHub will not allow you to push to a remote repository hosted on their servers.

Your options?

  1. Stay on Bitbucket, or
  2. rewrite the history of your repo (using, for instance, git filter-branch, or Roberto Tyley's BFG Repo-Cleaner) so that no file exceeding 100 Mb in size be present in any commit of that repo.