Discovering -Git LFS-

Ismailouahbi
3 min readNov 18, 2022

--

Photo by Roman Synkevych 🇺🇦 on Unsplash

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.

Git size limits — Account Management | FAQs & Technical Support | Nulab

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.

Git Large File Storage

GIF Image | Git LFS process

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
Create remote repo
  • Initialize Git Local Repository
Local Repo
  • Connect Local to Remote & push changes
trying to push

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
Add git lfs to our local repo
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
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
Remote repo

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.

--

--

Ismailouahbi

I share my unique experiences and insights, unraveling the complexities of machine learning and data science in an engaging and accessible manner.