使用git pull提示refusing to merge unrelated histories

这个问题出现在将本地项目改为git项目的过程中

将本地项目改为git项目,在当前项目根目录下执行

git init

线上创建git项目,获取到ssh地址或是http地址,然后指定本地项目的git地址为创建项目的地址

git remote add xxxx.git

尝试提交代码,初次提交需要先pull,这是就出现了标题的报错 fatal: refusing to merge unrelated histories,执行

git pull --allow-unrelated-histories

这样即可pull成功

unreleated histories

looking for the meaning

©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容