git pull error:”fatal unrelated_histories”

使用 git init初始化,当在github上创建和库,将本地和远程关联时,先调用

1
git pull origin master

出现异常 “fatal: unrelated_histories”

这是git2.9版本后出现的,该版本只允许使用共同源头的两个库或分支合并

所以要加上参数

1
git pull origin master --allow-unrelated-histories