Fatal: Refusing To Merge Unrelated Histories

08.10.2019by admin
Fatal: Refusing To Merge Unrelated Histories 3,7/5 2698 reviews
Histories

Fatal Refusing To Merge Unrelated Histories Tortoisegit

Fatal: The current branch master has no upstream branch. To push the current branch and set the remote as upstream, use git push -set-upstream origin master Step 7: Do as I'm told, and type: `git push -set-upstream origin master`.

Fatal: Refusing To Merge Unrelated HistoriesFatal: Refusing To Merge Unrelated Histories

Git Unrelated History

The default behavior has changed since git 2.9:'git merge' used to allow merging two branches that have no commonbase by default, which led to a brand new history of an existingproject created and then get pulled by an unsuspecting maintainer,which allowed an unnecessary parallel history merged into theexisting project. The command has been taught not to allow this bydefault, with an escape hatch -allow-unrelated-histories optionto be used in a rare event that merges histories of two projectsthat started their lives independently.See the for more information.You can use -allow-unrelated-histories to force the merge to happen. Since all the other answers are not actually answering the question, here is a solution inspired by this answer on a related question.So you get your error doing git rebase: $ git rebase origin/developmentfatal: refusing to merge unrelated historiesError redoing merge 1234deadbeef1234deadbeefThis error doesn't actually cancel the rebase, but you are now in the middle of it: $ git statusinteractive rebase in progress; onto 4321beefdeadLast command done (1 command done):pick 1234deadbeef1234deadbeef test merge commitSo you can now do the merge by hand.

Fatal Refusing To Merge Unrelated Histories During Git Pull

Fatal: refusing to merge unrelated histories さらにググってみたらmergeのオプションに「-allow-unrelated-histories」をつければOKと書いてあったので試してみる → merge OK!% git merge -allow-unrelated-histories origin/master Merge made by the 'recursive' strategy. Mac-mini:java-pj mvohra$ git merge origin/master -allow-unrelated-histories error: There was a problem with the editor 'vi'. Not committing merge; use 'git commit' to complete the merge. Mac-mini:java-pj mvohra$ git status On branch master All conflicts fixed but you are still merging. Lspdfr. (use 'git commit' to conclude merge) Changes to be committed.