Member-only story

The “fatal: refusing to merge unrelated histories” Git error

胡家維 Hu Kenneth
1 min readFeb 11, 2020

--

The “fatal: refusing to merge unrelated histories” Git error occurs when two unrelated projects are merged (i.e., projects that are not aware of each other’s existence and have mismatching commit histories).

Solution

The error is resolved by toggling the allow-unrelated-histories switch. After a git pull or git merge command, add the following tag:

git pull origin master --allow-unrelated-histories

More information can be found here, ​ on Git’s official documentation.

--

--

胡家維 Hu Kenneth
胡家維 Hu Kenneth

Written by 胡家維 Hu Kenneth

撰寫任何事情,O型水瓶混魔羯,咖啡愛好者,Full stack/blockchain Web3 developer,Founder of Blockchain&Dapps meetup ,Udemy teacher。 My Linktree: https://linktr.ee/kennethhutw

No responses yet