Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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?

like image 459
matanc1 Avatar asked Aug 19 '14 17:08

matanc1


People also ask

What is the file size limit for GitHub?

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).


2 Answers

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.
like image 176
jub0bs Avatar answered Oct 11 '22 12:10

jub0bs


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.

like image 24
Abhay Anand Avatar answered Oct 11 '22 11:10

Abhay Anand