如何合并从Bitbucket到GitHub的存储库
我在Bitbucket中有一个存储库。我们在GitHub中也有同一应用程序的代码。 我们需要将代码从Bitbucket拉到Github的存储库中。
我尝试的是:
- 从Github我创建了一个名为“ GH”的分支。
- 我从Bitbucket创建了一个名为“ BB”的分支。
然后从'gh'i ran''git pull https:{{url_to_bitbucket_repo}}}}。git
'。
运行此命令时,我会收到一个错误说:
error: Merging is not possible because you have unmerged files.
hint: Fix them up in the work tree, and then use 'git add/rm <file>'
hint: as appropriate to mark resolution and make a commit.
fatal: Exiting because of an unresolved conflict.
这似乎是一件容易的事,但是我遇到的问题找到了正确的“步骤 / git命令”。完成此操作的正确步骤 /命令是什么?
I have a repository in bitbucket. We also have code in GitHub for the same app.
We need to pull and merge the code from bitbucket into the repo in GitHub.
What I'm tried:
- From github I created a branch off of Master called 'gh'.
- From bitbucket I created a branch from Master called 'bb'.
Then from 'gh' I ran "git pull https:{{url_to_bitbucket_repo}}.git
".
When running this command I receive an error saying:
error: Merging is not possible because you have unmerged files.
hint: Fix them up in the work tree, and then use 'git add/rm <file>'
hint: as appropriate to mark resolution and make a commit.
fatal: Exiting because of an unresolved conflict.
This seems like it would be an easy thing to do but I'm having issues finding the right 'steps / git commands'. What would be the correct steps / commands for accomplishing this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我假设您想尝试合并Bitbucket和Github的代码历史记录。这对我有用:
GH
分支,并确保其干净(GIT状态)。git远程添加bitbucket&lt; insert_your_bb_url&gt;
bb
bb bitbucket远程分支的拉动 - 无关的历史注意:必要时,这将合并文件,可能会造成合并冲突。GH
分支:git推动原点GH
I'm assuming you want to try and merge the code histories from Bitbucket and GitHub. This worked for me:
gh
branch and make sure it is clean (git status).git remote add bitbucket <insert_your_bb_url>
bb
branch of your bitbucket remote:git pull bitbucket bb --allow-unrelated-histories
Note: this will merge files if necessary, possibly creating merge conflicts.gh
branch of your remote:git push origin gh