Use Git-lfs to upload large files over 100m to GitHub

1. Install git-lfs

After adding the environment variable, restart the computer

2. Install git-ifs in Git

  • git lfs install

3. Find all large files in the project

  • Configure the file types you want git-lfs to manage,
  • Suppose the large file you want to upload is a 1.mp4 file:
  • git lfs track 1 .mp4

4. After executing this command, the file .gitattributes will be generated in the project directory. At this time, Git push will submit .gitattributes to the remote warehouse.

  • After that, you can submit files with corresponding suffixes over 100M to Github.

5. Things to note

  • ⚠️ Note: This configuration file must be submitted before the large file is submitted. If the large file has been submitted, but .gitattributes has not yet been submitted, you need to use git reset --hard HEAD~1 to roll back to the previous version and submit again.

  • There is a space limit for uploading files through git-lfs. If a free user uploads a file exceeding 1G , the account will be frozen, so you must check how much space you have left before uploading.

  • setting-billing

  • github.com/settings/billingusage

Guess you like

Origin blog.csdn.net/u014723479/article/details/130776704