Introduction:
Are you encountering the frustrating "file size is over than 100MB" error when pushing your React or other framework/tool projects to GitHub? Fear not, as there's a solution – Git LFS (Large File Storage). GitHub restricts individual file sizes to 100MB, but Git LFS allows you to store large files separately and include pointers in your repository.
Step 1: Install Git LFS
# On Windows
winget install -e --id GitHub.GitLFS
# On Ubuntu
curl -s https://packagecloud.io/install/repositories/github/git-lfs/script.deb.sh | sudo bash
sudo apt-get install git-lfs
Step 2: Initialize Git LFS in Your Repository
git lfs install
Step 3: Track Large Files
To track specific files:
git lfs track "node_modules/**"
Replace node_modules/** with your desired files or use the following patterns:
For specific file extensions:
git lfs track ".<file-extension>"
For tracking single folder
git lfs track "<folder>/*"
For nested folders:
git lfs track "<folder>/**"
Conclusion:
By following these steps, you’ll effectively manage large files, ensuring a smooth experience when pushing your project to GitHub. Git LFS handles the heavy lifting, allowing you to focus on your code without worrying about file size limitations.
Closing:
Happy coding! 🚀 #GitHub #GitLFS #React #DevelopmentTips
This concise guide outlines the steps to integrate Git LFS into your project, overcoming GitHub's file size limitations and streamlining your development process.