我应该如何建立一个包含许多静态资源的 git 存储库?
我有一个 Rails 项目,有很多静态资源,主要是图像和 flash(超过 500MB)。包括 git 历史记录在内,整个存储库超过 1GB。
问题是,作为一名 Rails 开发人员,我实际上并不需要将所有这些资产放在同一个存储库中,因为这会使 git 变得非常慢。我不能只是从存储库中删除这些资产,因为从事该项目的其他人可能需要它们。
我考虑过对资产使用 git 子模块,但这可能会带来很多复杂性。
我能做些什么来让这样一个臃肿的项目工作更加顺利吗?处理大型项目的最佳实践有哪些?
I have a Rails project, with a lot of static assets, mostly images and flash (over 500MB). The whole repository is over 1GB when including git history.
The problem is, that as a Rails developer, I don't really need to have all of those assets in the same repository, since it makes git pretty slow. I can't just drop those assets from the repository, as there are other people working on the project who might need them.
I thought about using git submodules for the assets, but that might introduce a lot of complexity.
Is there anything I can do to make working with such a bloated project more smooth? What are some best practices for working with huge projects?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我真的建议将这些大型静态二进制数据存储在 artifact 存储库中,例如 Nexus。
这样的存储库不仅适用于 Java 项目,也不仅仅适用于“发布”或“快照”版本,还可以用于存储任何类型的二进制文件,从而使其管理和识别变得容易。
I would really recommend storing those large static binary data in a artifact repository, like for instance Nexus.
Such a repo isn't just for Java project, or isn't just for "release" or "snapshot" releases, but also for storing any kind of binary in away which makes its administration and identification easy.
尝试 git-annex。可以在这里找到更详细的答案:
https://stackoverflow.com/a/6635160/1524733
Try git-annex. A more detailed answer can be found here:
https://stackoverflow.com/a/6635160/1524733