0

Not able to Push React code in Github master due to larger size.

git push -u origin master Enumerating objects: 41025, done. Counting objects: 100% (41025/41025), done. Delta compression using up to 4 threads Compressing objects: 100% (25146/25146), done. Writing objects: 100% (41025/41025), 190.44 MiB | 5.20 MiB/s, done. Total 41025 (delta 14626), reused 41025 (delta 14626), pack-reused 0 remote: Resolving deltas: 100% (14626/14626), done. remote: warning: File node_modules/.cache/default-development/20.pack is 54.54 MB; this is larger than GitHub's recommended maximum file size of 50.00 MB remote: warning: File node_modules/.cache/default-development/101.pack is 79.78 MB; this is larger than GitHub's recommended maximum file size of 50.00 MB remote: error: Trace: 8dfc24e220167542a79ef96d0c9f68e0381fecd6e731ab98b3ad1c16716d2e46 remote: error: See http://git.io/iEPt8g for more information. remote: error: File node_modules/.cache/default-development/0.pack is 164.76 MB; this exceeds GitHub's file size limit of 100.00 MB remote: error: File node_modules/.cache/default-development/65.pack is 164.10 MB; this exceeds GitHub's file size limit of 100.00 MB remote: error: GH001: Large files detected. You may want to try Git Large File Storage - https://git-lfs.github.com. To https://github.com/u121/DemoPage.git ! [remote rejected] master -> master (pre-receive hook declined) error: failed to push some refs to 'https://github.com/u121/DemoPage.git' 

Getting this error when i use git push -u origin master in app

1
  • 1
    exclude node_modules using .gitignore Commented Feb 7, 2022 at 10:36

3 Answers 3

1

File node_modules/.cache/default-development/0.pack is 164.76 MB; this exceeds GitHub's file size limit of 100.00 MB.

In general, you don't want to push the node modules folder, but rather only push your package.json / package-lock.json and use npm install to download your dependencies.

Sign up to request clarification or add additional context in comments.

Comments

1

Add node_modules in .gitignore file. It will ignore node modules when you commit your code.

1 Comment

please be more precise, cite the added line to the .gitignore file
0

On top of the above answer, I see your repo doesn't have master on Github. Just double-check if this was intentional or your repo has protection that prevents you from pushing to master

Git push error pre-receive hook declined

NB: I don't have access to comment.

Comments