Safe master-master setup with git? (writable git mirror)

余生长醉 提交于 2019-12-12 02:39:08

问题


Have set up a master git repo and a mirror of it. After some experiments I detected a typical conflict resolution (mis)managment: without a warning, git just dropped conflicting commits -- a pretty much insane default setting.

After some perusing of SO, I tried

git config receive.denyNonFastForwards 1
git config receive.denyDeletes 1

but that does not solve the lost commit issue. When there are two conflicting commits in the master and in the mirror repo,

git remote update
git push --mirror

on the mirror overwrites the corresponding commit on the mirror. If you are lucky, the one who committed the deleted commit will detect this during his next pull.

Are there any other config options to either prevent forced updates/deletes, or to commit the whole conflict such that the next one to pull is able to resolve it no matter if he took part in producing the conflict or not?

Are there better SCMs out there? Or more precise: are there SCMs that handle conflict resolution more safely when being run in a distributed environment? Example: why not record two or more commits as "parallel" and let one of the next editors bring them back together? One could describe such a behavior as "auto branching". The equivalent of a "git pull" would then detect the new upstream branching point and require the user to decide which way to go....

来源:https://stackoverflow.com/questions/11588296/safe-master-master-setup-with-git-writable-git-mirror

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