git bitbucket 无法合并不相关的分支

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/15877947/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-19 08:24:58  来源:igfitidea点击:

bitbucket Unable to merge Unrelated branches

gitbitbucket

提问by user2257338

I have repository (lets say A) and forked repository A-dev on bitbucket. Everything had been worked good for 3 months. But recently, when I tried to create pull request in A-dev it says:

我在 bitbucket 上有存储库(可以说 A)和分叉存储库 A-dev。一切都运行良好 3 个月。但是最近,当我尝试在 A-dev 中创建拉取请求时,它说:

Unable to merge Unrelated branches

无法合并不相关的分支

Why this would happen and how it can be solved? Anyway to troubleshoot it?

为什么会发生这种情况以及如何解决?无论如何要解决它?

Thank you. EDITthe screenshot of the error

谢谢你。 编辑错误截图

回答by Sam

That means there would be merge conflicts if it attempted to merge. You have to merge in "Repo A" and resolve the conflicts. Then push back up to BitBucket so it can close the pull request. Example workflow:

这意味着如果它尝试合并,就会发生合并冲突。您必须合并“回购 A”并解决冲突。然后推回到 BitBucket 以便它可以关闭拉取请求。示例工作流程:

git remote add repo_a https://url.com/path/to/repo
git fetch repo_a
git merge repo_a/dev
# resolve conflicts
git commit -am "Merge in repo_a/dev and resolved conflicts"
git push origin dev

If you've never dealt with merge conflicts in Git, checkout this SO question.

如果您从未处理过 Git 中的合并冲突,请查看此SO 问题

回答by Jorge Wander Santana Ure?a

Try a:

尝试一个:

git rebase origin/[BRANCH-NAME]