使用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

你可能感兴趣的:(使用git pull提示refusing to merge unrelated histories)