简体   繁体   English

如何处理将master意外合并到功能分支中?

[英]How to deal with accidentally merging master into feature branch?

I tried to resolve merge conflict in a wrong repository, so I merged the master branch into a feature branch in the repository, which I shouldn't have done. 我试图解决错误的存储库中的合并冲突,因此我将master分支合并到了存储库中的功能分支中,这是我不应该做的。

How can i undo/correct that mistake? 我如何撤消/纠正该错误?

Can that cause some problem later on? 以后会引起一些问题吗? For example, when I try to pull to the master branch from a remote repository? 例如,当我尝试从远程存储库拉到master分支时?

Thanks. 谢谢。

Just do: 做就是了:

git reset --hard HEAD^

That will put you right back to before you did the merge. 这将使您回到合并之前的状态。 Then you can checkout the branch you should be on and do the correct merge. 然后,您可以签出您应该位于的分支并进行正确的合并。

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

相关问题 将主分支合并到功能分支,然后再次返回 - Merging master branch into feature branch then back again Git:是否将master合并到master上的功能分支和REBASING功能分支上? - Git: Are MERGING master into feature branch and REBASING feature branch on master equivalent? 将变更从master合并到已发布的功能分支中 - merging changes from master into a published feature branch 将功能分支合并到母版后重写历史记录 - Rewriting history after merging feature branch into master 功能分支合并到 Master 后发生变化 - Feature branch got change after merging it to Master 基于另一个功能分支合并功能分支,回到 master - Merging feature branch based on another feature branch, back to master git:我不小心将功能分支合并到master中,而不是进行合并 - git: I accidentally merged feature branch into master instead of develop 使用gitflow删除'feature'分支而不合并到master分支 - delete a 'feature' branch using gitflow without merging into master branch 将 Hotfix 分支合并到两者后,功能分支是 Master 后面的 1 个提交 - Feature branch is 1 commit behind Master after merging Hotfix branch to both 将来将master分支合并到feature分支会引起一些问题吗? - Will merging master branch into feature branch cause some problem in the future?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM