0

I get this error after I run npm run deploy (npm run build works fine). It says it's due to large files but I already set up git lfs. the second screenshot shows it is supposedly tracking the files. Maybe I setup git lfs wrong?

(https://i.sstatic.net/JpFdZel2.png) (https://i.sstatic.net/4gzPYWLj.png)

The repo is pushed to github and works fine but I'm not sure why npm run deploy doesnt work.

1
  • Please provide enough code so others can better understand or reproduce the problem. Commented Oct 6, 2024 at 2:23

1 Answer 1

1

Even if you were able to push the code to github with git lfs, it won't deploy to github pages if the file size was more than 100mb by default. As shown in your screenshot, I would advise the large files are hosted somewhere else and link those .mp4 files with some urls.

However, you can exclude the large files in your gh-pages branch by following the steps below :

  • Build your files with : npm run build

  • Checkout to your gh-pages branch with: git checkout gh-pages

  • Remove all the tracked files, including the files tracked by git lfs with: git rm -r * This removes all the files recursively.

  • Copy the files from the build folder, often dist with: cp -r dist/* . This copies all in the dist folder into . which is the current context of the gh-pages branch.

  • Then proceed to add the new changes to the branch and push to the desired github repository.

    git add .
    git commit -m "commit message"
    git push origin gh-pages
    
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.