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?
Note: If you add a file to a repository via a browser, the file can be no larger than 25 MB. For more information, see "Adding a file to a repository." GitHub blocks files larger than 100 MB. To track files beyond this limit, you must use Git Large File Storage (Git LFS).
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?
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.Github allows only maximum 100MB file. I also got same error while migrating from Bitbucket to Github.
Run commandsudo git filter-branch --tree-filter 'rm -rf /YOUR_PROJECT_LARGE_FILE_PATH' HEAD
:
It helped me to solve this issue. I got solution code from here.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With