I have a branch, "branch_x", that is part of the same repository as master. However, I foolishly started developing on branch_x without checking out from master. Therefore there is no common ancestor between master and branch_x, and when I tried doing a pull request to master, I simply got: There isn’t anything to compare. master and branch_x are entirely different commit histories.
Because of that fault, I made a fork of that repository. I am trying to merge the commits of branch_x into the master branch of the fork, and then I will try to request a pull between original repository and the fork (because now they have some history in common). However, I have no idea of how to actually merge branch_x from the original repo, to the master branch of the fork.
This post is similar, but I don't think that "git rebase -onto" will help much: There isn't anything to compare. Nothing to compare, branches are entirely different commit histories
I found this to work, do your normal flow from the branch_x
that you want to push up.
git add .
git commit -m "message"
git pull origin master(or whatever branch) --allow-unrelated-histories
git push origin branch_x
you should now be able to compare and PR
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With