Help
cancel
Showing results for 
Search instead for 
Did you mean: 
Ground Controller Lvl 2
Message 41 of 56

Re: How to deal with "refusing to merge unrelated histories" error

Yes it worked..!! Thanks a ton :)

Ground Controller Lvl 2
Message 42 of 56

Re: How to deal with "refusing to merge unrelated histories" error

Thanks...

this work for me...

 

git clone <Repo>

git pull --allow-unrelated-histories origin master

git push -u origin master

 

and it works

Ground Controller Lvl 1
Message 43 of 56

Re: How to deal with "refusing to merge unrelated histories" error

Worked perfectly in VS Code

Ground Controller Lvl 1
Message 44 of 56

Re: How to deal with "refusing to merge unrelated histories" error

if you already did a pull and you came up with master and origin/master but can't merge them, the following command can help you:

 

 

git merge origin/master --allow-unrelated-histories 

 

Ground Controller Lvl 1
Message 45 of 56

Re: How to deal with "refusing to merge unrelated histories" error

its working thanks man 

Ground Controller Lvl 2
Message 46 of 56

Re: How to deal with "refusing to merge unrelated histories" error

Yeah, it worked for me.

Ground Controller Lvl 2
Message 47 of 56

Re: How to deal with "refusing to merge unrelated histories" error

Its not working when I run the command on git bash.

$ git pull --allow-unrelated-histories
Result:  fatal: not a git repository (or any of the parent directories): .git

Ground Controller Lvl 1
Message 48 of 56

Re: How to deal with "refusing to merge unrelated histories" error

Someone please make this answer show up at the top of the thread lol! It fixed the problem for me and the current top positioned comment is completely the incorrect practice for solving the issue. Thanks again for correct pull to stop the unrelated histories error.

Ground Controller Lvl 2
Message 49 of 56

Re: How to deal with "refusing to merge unrelated histories" error

Thank you xvrtzn for the solution. You are amazing. I was having this issue from days but you helped right away. Thanks much!

Ground Controller Lvl 1
Message 50 of 56

Re: How to deal with "refusing to merge unrelated histories" error

this doesn't work either and git just sends you round and round in circles:

 

$ git pull --allow-unrelated-histories
There is no tracking information for the current branch.
Please specify which branch you want to merge with.
See git-pull(1) for details.

git pull <remote> <branch>

If you wish to set tracking information for this branch you can do so with:

git branch --set-upstream-to=<remote>/<branch> master