github错误 refusing to merge unrelated histories

错误复盘:

1、在github上创建一个代码仓;

2、在本地使用IDEA创建一个新的项目;

3、上传项目

git init
git add .
git commit -m "init
git remote add origin https://github.com/***.git"
git push origin master

在最后push时报错:

fatal: refusing to merge unrelated histories

使用如下命令解决

git pull --allow-unrelated-histories

猜你喜欢

转载自blog.csdn.net/hellboy0621/article/details/104091385
今日推荐