Discovering -Git LFS-
While working on a real project, I pushed some heavy content and got back this unwanted error message:
This indicates that the max file size you can push using git can’t exceed 100MO.
So, what to do in this case?
After some research, I’ve found a masterpiece that helped me efficiently resolve the issue without any new command system or new technology, thanks to Git for its rich system.
Git LFS:
Git Large File Storage (LFS) replaces large files such as audio samples, videos, datasets, and graphics with text pointers inside Git, while storing the file contents on a remote server like GitHub.com or GitHub Enterprise.
The process:
Without diving deep into the sea of details, let’s discover the process step by step by showing you my personal use case.
- Create GitHub Repository
- Initialize Git Local Repository
- Connect Local to Remote & push changes
Note:
As you can notice here my file exceeds 100MO so, we can’t push it to the remote server using the normal Git System.
- Integrate Git LFS
git lfs install : set up Git LFS for your user account
git lfs track "*.dll" : select the file types you'd like Git LFS to manage (or directly edit your .gitattributes)
git add .gitattributes : make sure .gitattributes is tracked
- Push to remote
git lfs migrate import : Convert Git objects to Git LFS pointers
git add . : Add current files to staging area
git commit : Commit changes
git push -u origin main : push main branch to github remote repository[origin]
- Check remote repository
That’s all for this article, stay tuned for my upcoming articles in which I’ll cover more advanced topics.
Thanks for your time,
Visit my website: Home — IsmailOuahbi.com
Follow me on LinkedIn for more.