简体   繁体   English

二进制文件的版本控制

[英]version control for binary files

I'm in the process of writing a program that will use its own binary format for storing data. 我正在编写一个程序,该程序将使用其自己的二进制格式存储数据。

I would like to make possible to have some form of version control, at the very least two different people should be able to make changes on a file and after that merge this changes. 我想使某种形式的版本控制成为可能,至少两个不同的人应该能够对文件进行更改,然后将这些更改合并。

As git seems to be a very common and very powerful version control system, I am wondering if it is possible to use it. 由于git似乎是一个非常常见且功能非常强大的版本控制系统,所以我想知道是否可以使用它。 I have only basic knowledge of git (pull add commit push), but I understand it has more advanced features. 我只有git的基本知识(pull add commit push),但是我知道它具有更高级的功能。 I want to understand if I can implement some basic functionality and get all the advanced features for free. 我想了解我是否可以实现一些基本功能并免费获得所有高级功能。

So the use case is that each project would consist of a sole binary file, and git would have to be able to work with it. 因此,用例是每个项目都将由一个唯一的二进制文件组成,而git必须能够使用它。

I've been searching and got to understand that I would have to write a custom mergetool ? 我一直在搜索,并且了解我是否必须编写一个自定义的mergetool? Is my understanding correct? 我的理解正确吗?

I also understand that a three-way merge is done by a diff3 program or at least that git has some of it functionality embedded. 我还了解到,三向合并是通过diff3程序完成的,或者至少git嵌入了其中的某些功能。 Would I have to write a custom version of it? 我需要编写一个自定义版本吗? Would it be even possible to use it with git? 甚至可以在git中使用它吗? Would it be necessary to recompile git? 是否需要重新编译git?

git also stores commits as changes in order to save space. git还会将提交存储为更改,以节省空间。 Does it use diff for it? 它使用diff吗? Would be possible to replace it? 可以更换吗? Would git need to be recompiled? git需要重新编译吗?
Is there any other kind of functionality that I would have to implement? 我还需要实现其他功能吗?
My initial plan was to use a single file for the project, but each project is made of independent sub-projects, that would be merged independently. 我最初的计划是对该项目使用一个文件,但是每个项目都是由独立的子项目组成的,这些子项目将被独立合并。 Would I gain anything by storing the project as different files for each subproject? 通过将项目存储为每个子项目的不同文件,我会有所收获吗?

Is there anywhere some good documentation on to what interface a diff , diff3 and mergetool must conform? 关于diff,diff3和mergetool必须符合哪个接口的地方,是否有任何好的文档? In which languages could these be written? 这些语言可以用哪种语言编写?

I'm quite confused because everyone seems to be interested in eliminating binary files from version control and apparently nobody wants to use git on them. 我很困惑,因为每个人似乎都对消除版本控制中的二进制文件感兴趣,而且显然没人愿意在它们上使用git。 Is it a bad idea? 这是一个坏主意吗? I feel like any kind of data for which merging makes sense in some way should be version controlled. 我觉得应该以某种方式对合并进行某种意义上的任何类型的数据进行版本控制。

So the use case is that each project would consist of a sole binary file, and git would have to be able to work with it. 因此,用例是每个项目都将由一个唯一的二进制文件组成,而git必须能够使用它。

There are 3rd party tools for handling binary files. 有用于处理二进制文件的第三方工具。

在此处输入图片说明


but each project is made of independent sub-projects 但每个项目都由独立的子项目组成

In git you have submodules && subtree for this purpose 在git中,为此您有子模块&&子树

git submodule add only pick latest Commit git子模块添加仅选择最新提交

在此处输入图片说明


Is there anywhere some good documentation on to what interface a diff , diff3 and mergetool must conform? 关于diff,diff3和mergetool必须符合哪个接口的地方,是否有任何好的文档?

In which languages could these be written? 这些语言可以用哪种语言编写?

Read this out, there is a references to diff2 & diff3 algorithm 阅读此内容,其中有对diff2和diff3算法的引用
What is the diff version git use? git版本的差异版本是什么? diff2 or diff3? diff2或diff3?

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

相关问题 声音,视频和其他二进制文件的版本控制 - Version control for sound, video, and other binary files 如何版本控制只有二进制文件的目录? - How to version control a directory with only binary files? 不存储文件的二进制文件的版本控制 - Version control for binary files that doesn't store the files 不同的版本控制系统如何处理二进制文件? - How do different version control systems handle binary files? 使用git版本控制系统锁定二进制文件 - Locking binary files using git version control system 使用版本控制系统处理自动更新的二进制文件 - handling of automatically updated binary files, with version control system 大型二进制文件和> 1TB存储库的版本控制? - Version control for large binary files and >1TB repositories? 版本控制系统是否使用差异来存储二进制文件? - Do version control systems use diffs to store binary files? 如何在本身不大,但 git 历史变大的版本控制系统中存储二进制文件? - How store binary files in a version control system that themselves are no big, but the git history get big? 当项目树有二进制文件时,GIT、Mercurial、SVN 或其他版本控制工具能否正常工作? - Can GIT, Mercurial, SVN, or other version control tools work well when project tree has binary files?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM