为什么会使用“git merge -s我们的”? [英] Why would one use "git merge -s ours"?

查看:260
本文介绍了为什么会使用“git merge -s我们的”?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

据我所知,我们的合并策略(听到 merge 的引号)实际上并不使用其他分支提交的任何提交。

我们的战略有时被称为保持对方的历史。但它将该历史记录为应用。奇怪的。 是否有我想要这种行为的情况?

另外,您也可以导入其他分支并让其历史记录在那里,它在哪里。



请注意,我正在询问-s我们的策略,而不是-x我们的选项以-s递归不同之处在于它适用于那些不冲突的提交)。

解决方案

一个用途是跳过提交在维护分支上,不打算返回到您的主/主干分支开发。查看这个先前的问题的例子:合并时跳过特定的提交 >


I understand that the "ours" merge strategy (hear the quotes around merge?) actually does not use any commits from the other branch.

The "ours" strategy is sometimes mentioned as "keeping the other's history". But it records that history as "applied". Weird. Are there cases where I do want this behaviour?

As an alternative, you could just as well import the other branch and let its history there, where it belongs.

Note that I am asking about the "-s ours" strategy, not the "-X ours" option to "-s recursive" (which is different in that it applies those commits that don't conflict).

解决方案

One use is to "skip" a commit made on a maintenance branch that isn't intended to go back into your main/trunk branch of development. See this previous question for an example: git - skipping specific commits when merging

这篇关于为什么会使用“git merge -s我们的”?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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