Reputation: 2293
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:
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?
Upvotes: 0
Views: 1211
Reputation: 2864
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
Upvotes: 1