本文介绍了将本地分支从经常重新分配的另一分支转移出去是不是很糟糕?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

假设我有本地分公司A / Origin / Master。我不断对分支A进行更改,获取远程主服务器并重新绑定。



然后我将A的本地分支B关闭。我不断对分支B进行更改然后重新绑定。



我是唯一一家在分支机构A和B工作的人。



这是一个糟糕的设置因为A的提交ID(哈希)可能会频繁更改?这会不会以任何方式破坏分支B的稳定性,或者使冲突更可能发生?

实际上,Git甚至是如何实现这种设置的?什么是B的HEAD如果A的提交ID不断从它下面改变出来?

解决方案

如果您处于这种类型的循环/ rebase)并且一遍又一遍地看到相同的冲突,您可以激活功能。

这样可以避免为每个rebase进行相同的冲突解决。



另请参阅,以获取更多信息。


Say I have local branch A off of origin/master. I am continuously making changes to branch A, fetching the remote master, and rebasing.

Then I have local branch B off of A. I am continuously making changes to branch B and rebasing.

I am the only one working on branches A and B.

Is this a bad setup since A's commit IDs (hashes) may be changing frequently? Does that destabilize branch B in any way or make conflicts more likely?

In fact, how does Git even implement this setup? What is B's HEAD if A's commit IDs keep changing out from under it?

解决方案

If you are in this type of cycle (fetch/rebase) and see the same conflicts over and over, you could activate the git rerere feature.
That will avoid having to do the same conflict resolution for each of your rebase.

See also "Are there any downsides to enabling git rerere?", "Fun with rerere" and "Rerere Your Boat..." for more.

这篇关于将本地分支从经常重新分配的另一分支转移出去是不是很糟糕?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-03 19:56