git push a file which is larger than 5MB

If a file is larger than 5MB size limit for pushing t, the files must be tracked and updated using git lfs.

Note: Please follow the instructions here(https://docs.github.com/en/free-pro-team@latest/github/managing-large-files/installing-git-large-file-storage) to install git lfs.

  1. Once you have installed use git lfs track the model files, or any files greater than 5 MB.
git lfs track "*.hdf5"
  1. The add the .git attributes file.
git add .gitattributes
  1. Then just continue to add the file, commit and push to the repo as you normally would.
git add file.hdf5
git commit -m "Commit message"
git push origin <commit branch>
原文地址:https://www.cnblogs.com/morganh/p/14247975.html