How to Push Files Over 100MB to GitHub: A Step-by-Step Guide with Git Large File Storage (LFS)
Learn how to manage large files in GitHub using Git Large File Storage (LFS) and follow a step-by-step guide to push files over 100MB to GitHub
Table of contents
Git Large File Storage (LFS)
Git Large File Storage (LFS) is a tool that allows large files to be stored outside of a Git repository while still being version controlled. Here are the step-by-step instructions to use Git LFS on the three major operating systems:
Windows:
Download and install Git LFS from git-lfs.github.com.
Open Git Bash or Git CMD and navigate to the repository directory.
Initialize Git LFS by typing "git lfs install" and press Enter.
Add the files you want to track with Git LFS by typing "git lfs track [filename]" and press Enter.
Commit and push the changes to the repository using Git as you would normally.
MacOS:
Download and install Git LFS from git-lfs.github.com.
Open Terminal and navigate to the repository directory.
Initialize Git LFS by typing "git lfs install" and press Enter.
Add the files you want to track with Git LFS by typing "git lfs track [filename]" and press Enter.
Commit and push the changes to the repository using Git as you would normally.
Linux:
Install Git by running the command "sudo apt-get install git" on Ubuntu or Debian or by downloading from git-scm.com/download/linux.
Download and install Git LFS from git-lfs.github.com.
Open Terminal and navigate to the repository directory.
Initialize Git LFS by typing "git lfs install" and press Enter.
Add the files you want to track with Git LFS by typing "git lfs track [filename]" and press Enter.
Commit and push the changes to the repository using Git as you would normally.
It is important to note that once Git LFS is installed and initialized, any large files added to the repository will be automatically tracked by Git LFS. To learn more about Git LFS, visit their website at git-lfs.github.com.
Conclusion
In conclusion, pushing large files to GitHub can be a challenge, especially if the file exceeds 100 MB. However, using Git Large File Storage (Git LFS) can make the process easier and more efficient. By following the step-by-step process outlined for Windows, Mac, and Linux operating systems, users can successfully push large files to GitHub without any issues. Git LFS is a powerful tool for managing large files in version control, and it's definitely worth exploring for any project that involves working with large files.