- Git Pull Origin Master Allow Unrelated Histories
- Git Pull Allow Unrelated Histories
- Git Pull Failed Unrelated Histories
- Sourcetree Refusing To Merge Unrelated Histories
Short version of my question : For years, I have been using a simple, single one-branch, one-contributor public online Github repo. A few days ago my computer died suddenly and I bought a new one. Now Github refuses to connect the local repo
from my new computer to the online repo saying “refusing to merge unrelated histories”. What do I do ?
一、fatal: refusing to merge unrelated histories. 今天在使用Git创建项目的时候，在两个分支合并的时候，出现了下面的这个错误。 /SpringSpace/newframe on master ⌚ 11: 35: 56 $ git merge origin/druid fatal: refusing to merge unrelated histories. 这里的问题的关键在于：fatal: refusing to merge. 'fatal: refusing to merge unrelated histories' Could someone guide me through some solutions? Sorry if this is an easy fix, I have tried many different fixes on numerous forums to no avail. Any help would be greatly appreciated. By default, git merge command refuses to merge histories that do not share a common ancestor. This option can be used to override this safety when merging histories of two projects that started their lives independently.
Long version of my question : here is the exact sequence of commands that I did in my new computer :
Step 1 : Download git, use
git config to tell git about my username & email. Worked fine.
All the following command were executed in my new local repo’s main directory
Step 2 :
git init. Worked fine.
Git Pull Origin Master Allow Unrelated Histories
Step 3 : Do a
git add on all my files. Worked fine.
Step 4 : Do the first commit :
git commit -m 'First commit from new computer'. Worked fine.
Step 5 : Do
git remote add origin [https://github.com/roparzhhemon/myremoterepo.git](https://github.com/roparzhhemon/myremoterepo.git). Worked fine, according to
git remote -v.
Step 6 :
git push. Got the following error message :
Step 7 : Do as I’m told, and type :
git push --set-upstream origin master. Got the following error message :
Step 8 : Do as I’m told, and type :
git pull. Got the following message :
Git Pull Allow Unrelated Histories
Git Pull Failed Unrelated Histories
Step 9 : Do as I’m told, and type :
git branch --set-upstream-to=origin/master master. Seemed to work, output the following :
Step 10 : Try
git pull again. Got the error message :
Sourcetree Refusing To Merge Unrelated Histories
Step 11 : Try
git push again. Got the error message :