android studio提交到开源git时出现:fatal: refusing to merge unrelated histories的解决办法

Posted 相心

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了android studio提交到开源git时出现:fatal: refusing to merge unrelated histories的解决办法相关的知识,希望对你有一定的参考价值。

创建本地库和fetch远程分支这些前面的步骤这里略过。可以自行百度。

解决办法:

1.cmd进入项目的根目录。

2.执行下面的命令:git pull origin master --allow-unrelated-histories。可以提交成功。

3.再次push。

 

有其它的好办法,欢迎建议。

以上是关于android studio提交到开源git时出现:fatal: refusing to merge unrelated histories的解决办法的主要内容,如果未能解决你的问题,请参考以下文章