简体   繁体   English

如何撤消合并引入的更改

[英]How to undo changes introduced by a merge

When merging develop into master I got a changes in master that makes master != develop even though they should have been identical. 当将development合并为master时,即使master和他们应该完全一样,master也会发生变化,从而使master!= development。 Reason for that is probably someone pushing conflicted files earlier in the project which has been fixed by changes in master that were not in develop. 造成这种情况的原因可能是有人在项目中较早地推送了冲突的文件,该文件已由不在开发中的master更改修复。

I don't want to reset to the hash since then I get the same problem with next merge. 我不想重置为哈希,因为那样我在下一次合并时会遇到相同的问题。 I want my develop-branch to be merged with master and then reset the files (not HEAD) to the hash develop had before merging so that when i commit git diff returns nothing. 我希望将自己的develop-branch与master合并,然后在合并之前将文件(不是HEAD)重置为hash development,以便在提交git diff时不返回任何内容。 Is this possible with git commands? git命令有可能吗?

So if I understand your question correctly, the files in master are correct, a merge from develop introduces unwanted changes. 因此,如果我正确理解了您的问题,那么master中的文件是正确的,develop的合并会带来不必要的更改。 Correct? 正确?

In this case you probably just want to merge develop in using a strategy that keeps your files unchanged. 在这种情况下,您可能只想使用可以使文件保持不变的策略来合并开发。

git merge develop -s ours

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM