在git获取后强制合并 [英] Forcing a merge after git fetch

查看:101
本文介绍了在git获取后强制合并的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

通常, git 的自动合并通过我不想要的方式执行合并操作,例如,删除本应保留的代码行需要删除。所以我尝试通过执行 git fetch 然后加上 git mergetool 来强制合并c $ c>,但它不允许我,并给了我没有文件需要合并的消息。

有什么办法强制手动合并,即使存在没有合并冲突?

解决方案

我想我没有对它进行重新说明,但我想要的是能够拉动在实际承诺之前对其进行更改和检查。我从 manojlds'在此主题中的答案中发现,要走的路是:

  git merge v1.0 --no-commit --no-ff 


Often, git's auto-merge performs a merge operation in ways I do not want, e.g., removing lines of code that should have been kept while keeping those that needs to be deleted.

So I tried forcing merge by performing git fetch followed by git mergetool, but it does not allow me, and gave me "No files need merging" message.

Is there any way to force manual merge even when there is no merge conflict?

解决方案

I think I didn't reword it right, but what I wanted was to be able to pull the changes and inspect it before it is actually committed. I found out from manojlds' answer in this thread that the way to go is:

git merge v1.0 --no-commit --no-ff

这篇关于在git获取后强制合并的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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