Multiple file versions in git-lfs

落花浮王杯 提交于 2019-12-21 11:05:41

问题


I'm trying to estimate the storage requirements for my project on GitHub and have a few questions about how git-lfs stores multiple versions of files:

  • Are multiple versions of files stored by git-lfs?
  • If so, will every change to a file result in the complete file being replicated, or are only differences stored?
  • Will all versions count towards the quota on github?
  • Is there any way to control how many versions are kept?

回答1:


Answering your questions:

  1. Are multiple versions of files stored by git-lfs?

    Yes. All file versions are stored by git-lfs.

  2. If so, will every change to a file result in the complete file being replicated, or are only differences stored?

    Yes. Every little change results in a new complete file stored.

  3. Will all versions count towards the quota on github?

    Yes. Every time a new version is pushed, the total file size is counted against your quota.

  4. Is there any way to control how many versions are kept?

    No. Git LFS hasn't a feature to do that yet.

See more details here.




回答2:


Even with Git-LFS 2.0 (released two days ago, mainly locking and transfert queue), the general principle remains the same.

Nothing in the official LFS spec mentions delta storage: Each version counts in full, and as commented on issue 1101

Git LFS has no way to prune old objects from the server that are still referenced by git commits

So controlling how many versions are kept, or having some kind of rolling storage (where n+1 version get dropped), is still to be implemented.

This is going on the roadmap for this year, but I'm not sure when we'll get to it.

There are many questions around that type of feature:

  1. How would you, as a user, want to purge LFS objects?
    • Would you purge a specific version of a file?
    • Would you purge ALL versions of a file?
    • Would you want to purge a range of versions? Maybe keep weekly checkpoints of active files or something.
  2. Do you want the ability to set policies on files, file types, or directories?
    • Keep n versions of a file.
    • Keep periodic (daily/weekly/monthly) checkpoints of files
  3. What would you expect Git LFS to do if it can't download a file that's been purged?
    • Pointer file
    • Nothing
  4. What would you expect Git LFS to do if it can't download a file due to some server issue?
    • Halt current checkout/clone/pull command
    • Pointer file
    • Nothing


来源:https://stackoverflow.com/questions/42604978/multiple-file-versions-in-git-lfs

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!