Documentation: Strapi generates large documentation files

System Information
  • Strapi Version: 4.1.5
  • Operating System: Ubuntu
  • Database: PostgreSQL
  • Node Version: 14.18.2
  • NPM Version: 6.14.15
  • Yarn Version:

Hi there,

I installed the documentation package, and when trying to push to GitHub, I’m getting the following error:

remote: error: File src/extensions/documentation/documentation/1.0.0/full_documentation.json is 160.31 MB; this exceeds GitHub's file size limit of 100.00 MB
remote: error: File src/extensions/documentation/documentation/1.0.0/full_documentation.json is 152.21 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 github.com:[organization]/[url].git
 ! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to '[url]

When running npx strapi uninstall documentation and specifying Yes to delete the plugin generated files in the extensions folder, all the other generated documentation doesn’t seem to get deleted. I’m interested in whether there are commands to delete the generated documentation?

Regarding the error that was occurring when pushing to git. This was as the error message said due a large file in my commit. Note that I had 5 commits to push.

However with thanks to a helpful guide (How can I remove a large file from my commit history? - DeployHQ), I was able to resolve this issue with the following command (you may need to alter the file path, please use with caution):

git filter-branch --force --index-filter \
  'git rm --cached --ignore-unmatch src/extensions/documentation/documentation/1.0.0/full_documentation.json' \
  --prune-empty --tag-name-filter cat -- --all