简体   繁体   English

合并分支但没有合并提交

[英]Merged a branch but there is no merge commit

I merged a branch in with git merge branchx, and it said: Fast-forward 我用git merge branchx合并了一个分支,它说:快进

and there is no merge commit. 并且没有合并提交。 How can I revert that merge if I want to? 如果需要,如何还原该合并?

Thanks 谢谢

As your git merge was merely a fast-forward, there is no merge commit to be undone. 由于您的git merge只是一个快进,因此没有要撤消的合并提交。 You can undo the effects with 您可以使用撤消效果

$ git reflog show master
$ git reset --keep master@{1}

In the future, if you'd like to force git to make a commit for fast-forward merges, use 将来,如果您想强制git进行快速转发合并,请使用

$ git merge --no-ff XXX/master

Reference: http://blog.tplus1.com/blog/2011/09/23/undo-a-fast-forward-git-merge/ 参考: http//blog.tplus1.com/blog/2011/09/23/undo-a-fast-forward-git-merge/

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

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