3

I'm new to LFS, and am in need of a clarification. If I use LFS for data files, will it reduce the overall repo size? Or will I have to store the data files remotely?

I have inherited a repo. There are several data files over 1 GB. It has exceeded the BitBucket 2GB limit and is now in read only mode.

merhoo
  • 589
  • 6
  • 18

1 Answers1

3

Unfortunately, unless you rewrite history and purge those files, the repo size will not shrink. The reason being that the files are still in commit history, even if they are deleted from HEAD.

Take a look here if you want to actually reduce the repo size by rewriting history (the tutorial is for github but should work for bitbucket with minor modifications).

https://github.com/git-lfs/git-lfs/wiki/Tutorial

Also, the equivalent bitbucket tutorial: https://www.atlassian.com/git/tutorials/git-lfs

Adnan Y
  • 2,982
  • 1
  • 26
  • 29
  • if someone were to clone my repo, i still want the code to work when it uses the data files. If I rewrite history like in the tutorial, and re-add them under lfs, will my repo size be all of the scripts + the references to the large files, or will it include the large files? – merhoo Feb 27 '19 at 02:16
  • 1
    I'm not sure what the question is but taking a stab at it, the lfs files are downloaded as part of the repository. The only difference being that they aren't version tracked nor kept in the reference list. Think of them as symlinks to files stored elsewhere in the cloud. – Adnan Y Feb 27 '19 at 02:18
  • sorry! when you add files to lfs, does the remote repo save the references or the files? if i clone the repo will the clone have references to the large files or the actual files? – merhoo Feb 27 '19 at 02:21
  • 1
    the repo stores pointer files. But you never see this, because they get swapped out for the real file at checkout. It's all explained in the linked tutorial. – bolov Feb 27 '19 at 02:24
  • 1
    link to files. The clone should automatically handle replacing the link to file to actual files so it should be transparent to the user. – Adnan Y Feb 27 '19 at 02:25