How Can I Push A Large Codebase On Github?

- 1 answer

I have a laravel project which is ~300Mb. I do not have individual large files in there but github does not allow me to push the code (100mb limit).

I read that I could use LFS but it is very confusing, I also tried to play around with my .gitignore (see below) however, nothing...


How can i sort this out?

thank you.



As you've mentioned that there is no large individual file, which means there is no need to enable the LFS. In case you want to know about Git Large File Storage, it is well explained on LFS manual

To tackle your problem of large repository of various small files, you should break down the repo into small chunks and commit them. As explained at Pushing Large Git Repository:

Pushing a large Git Repository can cause issues; time-outs, disconnects or general freezing tend to happen with especially large Git Repos. The best way to handle pushing those large git repos is to break the pushes down into commit chunks. Using git log you can decide how far back and how many chunks you would like to push your entire repo up by. Just make a note of the Git commit hashes you would like to upload, then you can execute the following command with the correct commit hash.

It is also recommended that you specify the full master location on the remote. After the push has finished choose another commit hash closer to master HEAD.

You may also like to squash your commits or checkout changes. With git it’s possible to squash previous commits into one. This is a great way to group certain changes together before sharing them with others. Checkout git log and git rebase commands. It will help get back to that commit.