锁定使用Git版本控制系统的二进制文件 [英] Locking binary files using git version control system

查看:1393
本文介绍了锁定使用Git版本控制系统的二进制文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

多年来一年半,我一直在从SVN使切换而去希望保持对Git的社区我的眼睛。拖我一个特别的问题是无法锁定二进制文件。在过去的一年我还没有看到在这个问题上的发展。据我所知,锁定文件违背了分布式源代码控制的基本原则,但我没有看到一个网络开发公司如何利用混帐的优势,跟踪源$ C ​​$ C和图像文件的变化时,有二进制文件的潜力冲突。

For one and a half years, I have been keeping my eyes on the git community in hopes of making the switch away from SVN. One particular issue holding me back is the inability to lock binary files. Throughout the past year I have yet to see developments on this issue. I understand that locking files goes against the fundamental principles of distributed source control, but I don't see how a web development company can take advantage of git to track source code and image file changes when there is the potential for binary file conflicts.

要达到锁定的效果,中央库必须进行标识。无论混帐的分布式特性,大多数公司将有一个软件项目中央资料库。我们应该能够文件标记为指定地址,需要从执政git仓库的锁。也许这是由困难的,因为Git跟踪文件的内容而不是文件?

To achieve the effects of locking, a "central" repository must be identified. Regardless of the distributed nature of git, most companies will have a "central" repository for a software project. We should be able to mark a file as requiring a lock from the governing git repository at a specified address. Perhaps this is made difficult because git tracks file contents not files?

做任何你在处理Git和二进制文件的经验,应该修改之前被锁定?

Do any of you have experience in dealing with git and binary files that should be locked before modification?

请注意:它看起来像源Gear的新的开源分布式版本控制项目,准确性和已锁定作为其目标之一。

NOTE: It looks like Source Gear's new open source distributed version control project, Veracity, has locking as one of its goals.

推荐答案

在回应马里奥与变化上的二进制文件的多个地方发生的额外关注。因此,情况是Alice和Bob都在同一时间进行更改,以相同的二进制资源。他们每个人都有自己的本地回购,从一个中央远程克隆。

In response to Mario's additional concern with changes happening in multiple places on the binaries. So the scenario is Alice and Bob are both making changes to the same binary resource at the same time. They each have their own local repo, cloned from one central remote.

这确实是一个潜在的问题。于是,爱丽丝完成第一和推到中央爱丽丝/更新分支。通常,当发生这种情况,爱丽丝会进行公告,它应该进行审查。 Bob看到和评论它。他可以(1)结合这些变化地投入到他的版本(从分支爱丽丝/更新,使他改变了)或(2)出版了自己的修改先令/更新。同样,他会作声明。

This is indeed a potential problem. So Alice finishes first and pushes to the central alice/update branch. Normally when this happens, Alice would make an announcement that it should be reviewed. Bob sees that and reviews it. He can either (1) incorporate those changes himself into his version (branching from alice/update and making his changes to that) or (2) publish his own changes to bob/update. Again, he makes an announcement.

现在,如果Alice推向相反,鲍勃有一个矛盾,他拉并合并时进入他的当地分支机构。他与Alice的冲突。但同样,相同的步骤可以应用,只是在不同的分支。而且,即使鲍勃忽略所有的警告,并承诺在Alice的,它总是能够拉出Alice的承诺解决的事情。这只是成为一个沟通的问题。

Now, if Alice pushes to master instead, Bob has a dilemma when he pulls master and tries to merge into his local branch. His conflicts with Alice's. But again, the same procedure can apply, just on different branches. And even if Bob ignores all the warnings and commits over Alice's, it's always possible to pull out Alice's commit to fix things. This becomes simply a communication issue.

由于(据我所知)Subversion的锁只是咨询,电子邮件或即时消息可以达到同样的目的。但是,即使你不这样做,GIT中让你解决它。

Since (AFAIK) the Subversion locks are just advisory, an e-mail or instant message could serve the same purpose. But even if you don't do that, Git lets you fix it.

没有,没有锁定机制本身。但锁定机制往往只是良好的沟通的替代品。我相信这就是为什么Git的开发尚未添加一个锁定机制。

No, there's no locking mechanism per se. But a locking mechanism tends to just be a substitute for good communication. I believe that's why the Git developers haven't added a locking mechanism.

这篇关于锁定使用Git版本控制系统的二进制文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆