$ git merge --allow-unrelated 222222222 --no-commitAutomatic merge went well; stopped before committing as requested$ git commit -C 1234deadbeef1234deadbeef[detached HEAD 909af09ec] test merge commitDate: Wed Jun 6 18:04:35 2018 +0200$ git rebase --continueSuccessfully rebased and updated refs/heads/test-branch.
error: failed to push some refs to 'https://github.com/lokeshub/myTODs.git'hint: Updates were rejected because the tip of your current branch is behindhint: its remote counterpart. Integrate the remote changes(e.g. hint: 'git pull ...') before pushing again.hint: See the 'Note about fast-forwards' in 'git push --help' for details.
为了克服这个我做了
git pull origin master
这导致了以下错误:
From https://github.com/lokeshub/myTODsbranch master -> FETCH_HEADfatal: refusing to merge unrelated histories**
From https://github.com/lokeshub/myTODs* branch master -> FETCH_HEADAuto-merging README.mdCONFLICT (add/add): Merge conflict in README.mdAutomatic merge failed;fix conflicts and then commit the result.
# It could be mastergit pull origin master --allow-unrelated-histories
# Or maingit pull origin main --allow-unrelated-histories
# Or just try with origingit pull origin main --allow-unrelated-histories