简体   繁体   English

Git仅用于源代码控制吗?

[英]Is Git only for source control?

Is it insane to integrate Git into the project that has nothing to do with source control. 将Git集成到与源代码控制无关的项目中是不是很疯狂。

I am thinking about data collector that regularly runs several commands on the client side and commit the output into the local git repository. 我正在考虑数据收集器,它定期在客户端运行几个命令并将输出提交到本地git存储库。 If remote server is available it pushes the data in origin for further processing on the server side. 如果远程服务器可用,则将数据推送到源中以便在服务器端进行进一步处理。 In this scenario I will have compression, history and various delivery methods for free. 在这种情况下,我将免费提供压缩,历史记录和各种交付方法。 What are the drawbacks? 有什么缺点?

It's not insane, no. 这不是疯了,不是。 Git was originally designed to just be a version controlled file-system, which would be later used as the basis for a source control system; Git最初只是一个版本控制的文件系统,后来被用作源控制系统的基础; however, things didn't quite go that way and git became the source control system. 然而,事情并没有那么顺利,git成为源控制系统。 That being said, it's still very much a file-system design, and there's no reason you couldn't use it for other purposes (in fact I was going to do something very similar myself, but the project never panned out). 话虽这么说,它仍然是一个文件系统设计,没有理由你不能将它用于其他目的(实际上我自己会做一些非常相似的事情,但项目从未淘汰)。

It depends on what kind of data you want to process. 这取决于您要处理的数据类型。 If you're talking about small bits of data, then use a database instead, but if you want to track modifications to documents, then I don't see a problem building your system on top of something like Git. 如果您正在谈论一小部分数据,那么请使用数据库,但如果您想跟踪对文档的修改,那么我认为在Git等基础上构建系统没有问题。

There are already several backup systems available based on Git, for example Gibak . 已有几种基于Git的备份系统,例如Gibak So it's definitely able to handle large datasets efficiently/secure. 因此,它绝对能够有效/安全地处理大型数据集。

A drawback will be, that you won't be able to merge binary data. 缺点是,您将无法合并二进制数据。

"Git is a free & open source, distributed version control system designed to handle everything from small to very large projects with speed and efficiency. “Git是一个免费的开源分布式版本控制系统,旨在快速高效地处理从小型项目到大型项目的所有事务。

Every Git clone is a full-fledged repository with complete history and full revision tracking capabilities, not dependent on network access or a central server. 每个Git克隆都是一个成熟的存储库,具有完整的历史记录和完整的修订版跟踪功能,不依赖于网络访问或中央服务器。 Branching and merging are fast and easy to do. 分支和合并是快速且容易的。

Git is used for version control of files, much like tools such as Mercurial, Bazaar, Subversion, CVS, Perforce, and Visual SourceSafe. Git用于文件的版本控制,很像Mercurial,Bazaar,Subversion,CVS,Perforce和Visual SourceSafe等工具。 "

no its not just for source control. 不仅仅是源控制。

people use it as a versioning system for all kinds of documents like manuscripts, speeches, etc... 人们将它用作各种文件的版本控制系统,如手稿,演讲等......

git doesn't have to be used with software source control, you can use it however you want git不必与软件源控件一起使用,您可以随意使用它

To me, it would seem easier to collect data in a database. 对我来说,在数据库中收集数据似乎更容易。 In a database, the information is organized, easily accessible, and can be manipulated easily. 在数据库中,信息被组织,易于访问,并且可以轻松操作。 Also, if you need accessible to people remotely, allow other domains access to the database. 此外,如果您需要远程访问人员,请允许其他域访问数据库。

Whereas in Git, you're stuck storing everything into flatfiles. 而在Git中,你却被困在平面文件中。 It is your job to then parse all that information, and if you have a lot of information, this can take a long time. 然后,您的工作就是解析所有信息,如果您有大量信息,这可能需要很长时间。 However, databases are usually pretty quick about returning the exact information you want. 但是,数据库通常可以快速返回所需的确切信息。

Sounds like what you are looking for is a messaging queue or service bus of some kind. 听起来你正在寻找的是某种消息队列或服务总线。 There are many of those. 其中有很多。 Of course, if Git works for you, why not? 当然,如果Git适合你,为什么不呢? But just make sure you aren't just using it because it is the only tool like it that you know. 但是请确保您不仅仅使用它,因为它是您知道的唯一类似工具。

I can't see how this would be a bad idea. 我看不出这是个坏主意。 Git is great for managing large and small amounts of information. Git非常适合管理大量和小量的信息。 Binary or text are both allowed and kept revision history of. 允许二进制或文本并保留修订历史记录。

This could probably work just like iFolder , but with much better ability to merge, keep history and share your information. 这可能就像iFolder一样,但具有更好的合并能力,保留历史记录并分享您的信息。

One of the problems is the complexity unerlying this kind of setup. 其中一个问题是这种设置的复杂性。 Unless your users are well versed in git branching, conflict resolution by merging, and applying patches manually, you will have to make some tough decisions on how to dumb down the system. 除非您的用户精通git分支,通过合并解决冲突以及手动应用补丁,否则您将不得不就如何使系统愚蠢做出一些艰难的决定。

The idea of GUID is also going to be confusing to end users, so you might have to build something simple (version numbering) on top of that. GUID的想法也会让最终用户感到困惑,因此您可能需要在此基础上构建简单的(版本编号)。 The no-empty-folders allowed dilemma is also one you will have to address. 无空文件夹允许的困境也是你必须要解决的问题。

The good thing about git (as opposed to svn or iFolder) is that moving a file is easy, and merges are smart. 关于git(与svn或iFolder相反)的好处是移动文件很容易,并且合并很聪明。

Overall, git does good managing our binary image, media and code files all in one repository. 总的来说,git可以在一个存储库中管理我们的二进制映像,媒体和代码文件。 I can't think of why it could not be used as a helper for any other kind of project, to keep track of documents, images and other media. 我想不出为什么它不能用作任何其他类型项目的帮助者,以跟踪文档,图像和其他媒体。

I use Subversion for database backups. 我使用Subversion进行数据库备份。 One row per record with many static records makes svn a quick and easy backup solution. 每条记录一行有许多静态记录,这使得svn成为一种快速简便的备份解决方案。 No meaningful drawbacks that I can see. 没有任何有意义的缺点,我可以看到。 From one random Internet guy to another: you have my support! 从一个随机的互联网家伙到另一个:你有我的支持!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM