如何在git中使用我的更改进行合并? [英] How to use my changes for merge in git?

查看:92
本文介绍了如何在git中使用我的更改进行合并?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在git中合并时强制执行我的更改?有人把所有的bin目录放在git中,现在我有一个可怕的合并冲突:($ / b>

现在它说:


当你解决这个问题时,
运行git rebase --continue,如果你
愿意跳过这个补丁,那么运行
代替运行git rebase --skip。到
恢复原始分支并停止
重新绑定运行git rebase --abort。

我不想合并,我只想使用我的更改删除所有这些文件。



编辑:大多数文件已成功合并,无论是通过自动合并还是因为没有冲突。但仍然存在一些文件,如下所示。


警告:无法合并二进制文件:
src / reports / obj / Debug / TempPE / GroupMailDS.Designer.cs.dll
(HEAD与添加的gitignore)


解决方案

我不是100%信任但我认为这是一个很好的例子:

  git merge otherbranch -s recursive -X our 

该命令尝试使用递归策略将主题分支合并到检出分支中。 -X我们的选项是递归策略的一个子集,通过假设您当前签出的分支是权威的来自动解决冲突。


How do I force "my changes" when merging in git? Someone put all bin directories in git and now I have a terrible merge conflict :(

Now it says the following:

When you have resolved this problem run "git rebase --continue". If you would prefer to skip this patch, instead run "git rebase --skip". To restore the original branch and stop rebasing run "git rebase --abort".

I do NOT want to merge, i just want to delete all those files using my changes.

EDIT: Most of the files was successfully merged, either through automatic merge or because there was no conflict. However quite a few still exist like the following one.

warning: Cannot merge binary files: src/reports/obj/Debug/TempPE/GroupMailDS.Designer.cs.dll (HEAD vs. added gitignore)

解决方案

I'm not 100% confident about this, but I think this is a good case for this:

git merge otherbranch -s recursive -X ours

That command attempts to merge the topic branch into your checked out branch using the recursive strategy. The -X ours option is a subset of the recursive strategy that automatically resolves conflicts by making the assumption that your currently checked out branch is authoritative.

这篇关于如何在git中使用我的更改进行合并?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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