5

Git large file system git-lfs could be used to store large files and at a txt file to the git repository. The question is when to decide whether a file should go to git LFS and if that is done whether the existing CI configuration will break.

Sometimes jars are added to a repository like the gradlew.jar. According to me, binaries like jars should not be stored in git as these are not text files that change, but a binary does not have to be large.

Currently we have multiple git repositories that contain jar files. I wonder whether all these jars should be moved to git-lfs.

  • What do you want to store? – gumol Dec 3 '17 at 16:26
  • Additional paragraph added. – 030 Dec 3 '17 at 16:56
3
+50

When to decide whether a file should go to git LFS

Your files can go to git-lfs at any time, but it would be inneficient to implement this solution for few files. Specially if it's basic gradlew jars.

I have used the gradlew strategy previously. The idea is to push this "wrapper" along your code to make the build process portable. Any platform with the proper JRE will be able to build the application in a similar fashion. This removes the headache of enforcing teams to install specific versions of gradle.

The purpose of gi-lfs is to leverage the benefits of git along with the ability to store large files remotely by caching them and indexing them. It reduces the burden of downloading a big repository when binaries are stored.

In my opinion you should start consider this solution when:

  • Your git repository contains large files (anything in the MB magnitude)

  • They represent the main content of your repository

  • These files are updated regularly

  • It is taking your CI tool minutes to pull/clone the repository

If you consider this solution to track binary versions, I would suggest you go for binary repositories instead such as:

Does the existing CI configuration will break

If you decide to go git-lfs, the normal git commands won't work. You will need to either create symbolic links toward git-lfs after doing the setup or add lfs after git in your CI tool. i.e. git clone becomes git lfs clone.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.